LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-16-2003, 09:57 AM   #1
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Rep: Reputation: 30
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,
 
Old 09-16-2003, 11:16 AM   #2
abarclay
LQ Newbie
 
Registered: Aug 2003
Posts: 25

Rep: Reputation: 5
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.
 
Old 09-16-2003, 11:23 AM   #3
abarclay
LQ Newbie
 
Registered: Aug 2003
Posts: 25

Rep: Reputation: 5
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.
 
Old 09-16-2003, 11:23 AM   #4
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Original Poster
Rep: Reputation: 30
I'll give it a shot. Thanks for your help!
 
Old 09-16-2003, 03:59 PM   #5
viniosity
Member
 
Registered: Oct 2001
Location: Washington, DC
Distribution: Debian, Archlinux, Ubuntu, Sidux
Posts: 244

Original Poster
Rep: Reputation: 30
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cache DNS server and zone file DanielTan Linux - Networking 7 09-26-2005 11:00 AM
DNS zone file question DanielTan Linux - General 3 09-21-2005 09:52 PM
help please with bind zone file config smoalne Linux - Newbie 2 12-16-2004 10:56 PM
Need help with DNS zone file please:-) TippyToes Linux - Networking 5 04-28-2004 05:32 PM
BIND DNS Problems with Zone file and Config Init-0 Linux - Networking 6 07-30-2003 04:58 PM


All times are GMT -5. The time now is 08:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration