Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Apr 1999 15:19:51 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Nicole Harrington <nicole@nmhtech.com>
Cc:        freebsd-isp@FreeBSD.ORG
Subject:   Re: web servers and canonotical domains
Message-ID:  <19990423151951.O91260@freebie.lemis.com>
In-Reply-To: <XFMail.990422223142.nicole@nmhtech.com>; from Nicole Harrington on Thu, Apr 22, 1999 at 10:31:42PM -0700
References:  <XFMail.990422223142.nicole@nmhtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday, 22 April 1999 at 22:31:42 -0700, Nicole Harrington wrote:
>
>
>  OK, I may be asking a boneheaded question, but here goes.
>
>  I have a mailserver and a web server for a domain. www.domain.com goes to the
> web server. Domain.com and the MX record point to the mail server. Well, now the
> execs want http://domain.com to go to the web server.
>
> 1) What is the best way to do this?

You don't need to change the MX, of course, but you do need to change
the A record.  Theoretically, this isn't a problem: web browsers use
the A record, MTAs should use the MX record.

> 2) What is the best way to do this based on the fact that most of our
> hosted domains are the same way and would be plenty upset if their customers
> type http://otherdomain.com and got Our web page.

I don't quite understand.  I'm assuming you're running apache, so
you'll need to tell apache which domain to give for each domain name.
But that's straightforward.

> 3) If I just take domain.com and make IN A X.X.X.X of the web server, it seems
> many stupid mailers out there don't pay alot of attention to the MX record and
> report no mailer daemon and bounce.

That's why I said "theoretically" above.  This is the one problem.
Now you *could* say "forget them", but there's probably a simpler way:
run sendmail on the web server and make the web server a
higher-priority MX for the mail server.  Then those few misguided
mailers which send to domain.com A instead of domain.com MX will still
get through.  I don't expect the volume would be enough to worry about.

>  I thought of a perl script that opened a port 80 socket and simply said
>  "if $www.domain.com" then send BAD URL" (to prevent looping)
>  " if .$domain.com send  error code moved permenently - (redirecting to
> www.$domain.com)
>
>  Would this work?

Not really.  Your problem is with mail, not http.  If you really
wanted to keep separate IP addresses for www.domain.com and
domain.com, you could run a small web server on the mail server and
redirect from there, but I think this is the wrong solution: there's
nothing wrong with the web clients, it's broken mail clients that are
the problem.

> anyone done something like this. I don't want to route the web
> traffic through the mail server and I don't want to route mail
> traffic through the web server.

I'm suggesting that you could afford to route some mail through the
web server.  I don't think it would be very much, less than 1% of the
full load.  You have alternatives, of course: either ignore the
problem (people with broken mailers can't send you messages) or get
sendmail on that system to answer "go away, get a real MTA".

Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990423151951.O91260>