DNS Zone file config for mail server
I've got a web server that sometimes sends out mail. Because of the configuration of my ISP, all servers inside my building will not resolve by external IP address so I had to set up a DNS server to resolve the servers that are internal (such as intranet.foo.com, mail.foo.com, and www.foo.com)
The problem is that my web server is sending the mail but it's not getting there. The mail ends up staying local and this what I get: <viniosity@foo.com>: Name service error for foo.com: Host found but no data record of requested type --0E70617E21.1063766702/voyager.eco Content-Description: Delivery error report Content-Type: message/delivery-status Reporting-MTA: dns; voyager.eco Arrival-Date: Tue, 16 Sep 2003 22:45:02 -0400 (EDT) Final-Recipient: rfc822; viniosity@foo.com Action: failed Status: 5.0.0 Diagnostic-Code: X-Postfix; Name service error for foo.com: Host found but no data record of requested type --0E70617E21.1063766702/voyager.eco Content-Description: Undelivered Message Content-Type: message/rfc822 Received: by voyager.eco (Postfix, from userid 1000) id 0E70617E21; Tue, 16 Sep 2003 22:45:02 -0400 (EDT) To: viniosity@foo.com Subject: testsubject Message-Id: <20030917024502.0E70617E21@voyager.eco> Date: Tue, 16 Sep 2003 22:45:02 -0400 (EDT) From: vw@eco.com (Vincent) This is test mail --0E70617E21.1063766702/voyager.eco-- Here is the zone file for foo.com on the eco.com server: ; ; BIND reverse data file for local loopback interface ; $TTL 604800 @ IN SOA foo.com. root.foo.com. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 604800 ) ; Negative Cache TTL ; @ IN NS foo.com. 1.0.0 IN PTR localhost. IN MX 10 dns.mail.foo.com ; mail server ; #www CNAME dns ftp CNAME dns #smtp CNAME dns pop CNAME dns proxy CNAME dns news CNAME dns ; mail A 192.168.1.8 www A 192.168.1.14 intranet A 192.168.1.237 ; mail.foo.com does resolve to 192.168.1.8 but as detailed above I get an error saying host found but no data record of requested type. Am I missing something in my zone file? Else, maybe something is wrong with the IN MX 10 dns.mail.foo.com line? Help! TIA, |
You've got several problems here...
This is a forward file, so no PTR records are needed/allowed. Delete the comment at the top as its not valid. Your TTL is WAYYYYYYY too long... If any other servers are using this information, they will cache it for a month which will make it hard to change. Use 60 seconds until you get it working, then use 86400 (1 day) after that. The negative cache time should be much shorter than a month - more like 60 seconds - 1 day at the max. Is your DNS server really named "foo.com"? I've changed it to dns.foo.com, as thats what I *think* you meant. dns.mail.foo.com doesn't have an A record.... thats the big problem. Although sendmail might bitch about the MX record pointing to a CNAME, postfix will be fine with it, and its cleaner in my opinion. I've re-written the zone file for you here: $TTL 86400 foo.com. IN SOA foo.com. root.foo.com. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 3600 ) ; Negative Cache TTL IN NS dns.foo.com. IN MX 10 mail.foo.com dns IN A 192.168.1.8 www IN A 192.168.1.14 intranet IN A 192.168.1.237 mail IN CNAME dns.foo.com. ftp IN CNAME dns.foo.com. pop IN CNAME dns.foo.com. proxy IN CNAME dns.foo.com. news IN CNAME dns.foo.com. |
Fricking parser removed the spaces which are significant!
Oh well, I can't figure out how to get it to preserve space, so I've just made it verbose (added in all the zone names). $TTL 86400 foo.com. IN SOA foo.com. root.foo.com. ( 1 ; Serial 604800 ; Refresh 86400 ; Retry 2419200 ; Expire 3600 ) ; Negative Cache TTL foo.com. IN NS dns.foo.com. foo.com. IN MX 10 mail.foo.com dns IN A 192.168.1.8 www IN A 192.168.1.14 intranet IN A 192.168.1.237 mail IN CNAME dns.foo.com. ftp IN CNAME dns.foo.com. pop IN CNAME dns.foo.com. proxy IN CNAME dns.foo.com. news IN CNAME dns.foo.com. |
I'll give it a shot. Thanks for your help!
|
I'm going to go ahead and make your chances on my primary DNS server. But for my web server I made this change and it started working:
foo.com. IN MX 10 mail.foo.com. ; mail server (foo is just a random name.. not the actual name) I found a really nice FAQ here: http://support.algx.net/cst/dns/dns2.html Thanks for your help though.. of all the forums I tried this is the only one I got a response on! |
All times are GMT -5. The time now is 11:22 PM. |