#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0

    Prevent mail.domain.com from pointing to website


    Hi there,

    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.

    Thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    289
    Rep Power
    44
    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.

    J.A. Coutts
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0
    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?
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0
    Originally Posted by E-Oreo
    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.
    Thanks for the reply.

    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.
  10. #6
  11. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    I'm referring to external IPs. Your ISP would have to provision more than one for you, or you would need a second connection.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    4
    Rep Power
    0
    Originally Posted by E-Oreo
    I'm referring to external IPs. Your ISP would have to provision more than one for you, or you would need a second connection.
    Thanks for the help so far!

    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?
  14. #8
  15. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    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.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo