December 12th, 2012, 10:29 PM
Prevent mail.domain.com from pointing to website
I've searched and searched but I can't really find an answer to this question.
(domain.com not actually the domain, used for example here)
Basically I want to use mail.domain.com to point to my mail server and have it used that way. I've set up an A record which is mail.domain.com which points to the servers IP address.
I've also created an MX record as domain.com to 10:mail.domain.com
This works fine for mail, but the question/problem I have is that when you actually visit mail.domain.com in a web browser, it loads the website on the server because that A record is pointing to the IP. So it acts as if you're just directly typing the IP into the browser.
Most sites I see have it set up so they use mail.domain.com for their mail, but if you punch mail.domain.com into the browser address bar, it doesn't resolve anywhere.
Why is this? Should I be setting up my MX/A records a different way? I don't want mail.domain.com to point to the site (port 80), I only want it to be used for the sites mail.
Hope this makes sense, any help would be appreciated.
December 13th, 2012, 02:28 AM
Your problem is not with DNS, but with the Web server. The DNS correctly finds the IP address of the fully qualified domain name. The GET request is sent to the IP address using the URL http://mail.domain.com. If the Web server is set up properly, it should not recognize and respond to that domain name. I have verified that on my own domain.
December 13th, 2012, 04:16 AM
I'm using OSX10.6 server.
What sort of settings under Web would I need to adjust?
What am I looking for to configure it only for mail?
December 13th, 2012, 07:29 PM
You would need to create a vhost for the mail subdomain and have it serve a blank page or an error page.
Most of the sites you visit probably are not running a web server on the same IP as their mail server.
DNS can not deal with ports or protocols, so there is no way you can make the subdomain not resolve when it is typed into a browser. All you can do is control response is sent.
If your server has more than one IP address, you could have www. and mail. resolve to different IP addresses. Then your web server could be configured to listen only to the IP address used by www.
December 13th, 2012, 07:50 PM
Thanks for the reply.
Originally Posted by E-Oreo
I'm just hosting from home and I'm provided with a static IP for my connection.
When you say "If your server has more than one IP address", how could this be achieved? How could I obtain more than one external IP? Wouldn't that require multiple internet connections? Or are you referring to local IP's or something?
Noob as hell on that one, but I understand what you mean if I was to have multiple IP's.
December 13th, 2012, 08:33 PM
I'm referring to external IPs. Your ISP would have to provision more than one for you, or you would need a second connection.
December 13th, 2012, 08:54 PM
Thanks for the help so far!
Originally Posted by E-Oreo
I can see my ISP offers the ability to purchase additional IPs.
Is it then possible to set up my server to accept both public IP's (after configuring on modem) and separate one IP for web and one for mail on the same machine? How would that be achieved?
December 13th, 2012, 10:08 PM
Yes, you would configure your web server and mail server software to only listen to a particular IP. I don't know how to do that on OSX.