JudgementDay Posted February 4, 2012 Share Posted February 4, 2012 I just added a MX record to my zone file. I queried a MX record for my domain name straight after, but nothing returned. I am guessing the server I use for DNS lookup will be using a cached record, rather than looking up my DNS server real time, and that their cache will be flushed when their server does a periodic lookup on my DNS server, which will probably be within 48 hours, right? Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/ Share on other sites More sharing options...
Andy-H Posted February 4, 2012 Share Posted February 4, 2012 As far as I know, yes Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314293 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 You can use a tool like dig to query dns servers for the information. You could use it to query your nameserver directly (the one with the zone file) to ensure it returns the correct information. You may also be able to see how much time remains before the server your querying updates it's cache. For example, if I query my domain: kicken@bonzi:~$ dig MX aoeex.com [..snip..] ;; ANSWER SECTION: aoeex.com. 3600 IN MX 0 sitemail.everyone.net. The 3600 is the TTL value meaning that server will serve that response for 3600 seconds before it updates it by checking the master server again. Essentially, it is now cached for the next hour. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314295 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 Thanks guys. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314302 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 Cool. My DNS server has updated its cache with my new zone file. There is something I am not happy about though... when I goto the URL 'mail.mydomain.com', it goes to my webpage 'mydomain.com', when it shouldn't be doing anything. I added this to my zone file when adding the MX. Have I did it right? IN MX 10 mail.mydomain.com. mail IN A 201.124.95.75 How can I stop this behavior? Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314306 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 You would just have to configure your web server such that if someone went to that domain it would redirect them to your main domain instead. I wouldn't worry about it too much, so long as your not linking or advertising your mail.mydomain.com around the internet nobody should really be using it when trying to surf to your site. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314307 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 Heh, I worry allot. To me, its another entry point. If I removed what I have entered into my zone file, and it replaced it with this: mydomain.com IN MX 10 mail.mydomain.com. ... would it solve my problem? Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314308 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 You need an A record for your mail.mydomain.com otherwise the mail servers on the web wouldn't know how to contact your mail server because they wouldn't know it's IP address. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314310 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 mail.mydomain.com doesn't actually exist. The only reason I need an MX record is so other SMTP servers can verify me via MX lookup. Would this be sufficient? IN MX 10 Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314311 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 I don't see a reason to have an MX record at all if there is no server that accepts mail for your domain. If your not accepting mail, then you should fail an MX check. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314315 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 No way.. I have been running a SMTP server for 2 years without any of this, and people have been able to contact me fine. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314316 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 No way.. I have been running a SMTP server for 2 years without any of this, and people have been able to contact me fine. If there is no MX record, SMTP servers will fallback on the A record for the domain and attempt to deliver to that IP. You should have an MX record if your accepting mail though, and it should point to whatever your mail server's host name is, and that host name must have an A record to resolve it's IP address. Transaction sort of goes like this: mail to you@mydomain.com: - server queries MX records for mydomain.com. Receives back a list of hostnames, in your case mail.mydomain.com - server queries A record for mail.mydomain.com. If an IP is received, connect to that IP and deliver the mail - if it fails to connect, it tries the next server in the MX list (sorted by the preference). - if all mx servers fail (or no mx record) it will query an A record for mydomain.com and try to deliver the mail to there. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314318 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 I see. Thats very fascinating. You have made it so much clearer. I have formulated this solution to stop my problem with mail.mydomain.com showing in a web browser: IN MX 10 mydomain.com. mydomain.com. IN A 202.136.92.37 Should this be ok? Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314322 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 As far as I know, yes that should be fine. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314323 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 I can't thank you enough for your help and patience, and I hope what goes around comes around for you. Good day to you! Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314324 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 I have just had an interesting thought. I've got this ok: IN MX 10 mydomain.com. mydomain.com. IN A 202.136.92.37 ... well, wouldn't the second line not be necessary? I'm guessing because my domains glue record already points to my IP address? or are chances that most MTA software are not sophisticated enough to put the two together, and I will need an A record regardless for the MX record target? Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314326 Share on other sites More sharing options...
kicken Posted February 4, 2012 Share Posted February 4, 2012 So long as your have an A record somewhere that allows mydomain.com to resolve to an IP you should be fine. The glue records should suffice. Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314327 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 OK!! I think I have an understanding now. I am about to go ahead and save this zone file. Does it look correct? http://i39.tinypic.com/fmt3lk.png Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314329 Share on other sites More sharing options...
JudgementDay Posted February 4, 2012 Author Share Posted February 4, 2012 It seems there is an RFC law that requires it point to a hostname. I can't understand the point in this law. Seems real stupid. Anyhow, I've abided to it. I'm done. Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/256361-are-mx-lookups-real-time/#findComment-1314331 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.