Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-18-2010, 06:14 AM
Intermediate Member
 
Posts: 21
Unhappy Properly setting up DNS and MX

Hello,

while trying to resolve another problem it came up that my DNS and MX records aren't properly set up. In order not to mess up the already log-filled thread I hope it's ok if a start another one for that problem.

First the outputs of some commands:

cat /etc/hosts
Code:
zimbra@srvXXXX:~$ cat /etc/hosts
127.0.0.1	localhost.localdomain	localhost
95.xxx.xx.xx	srvXXXX.provider.tld	srvXXXX
cat /etc/resolv.conf
Code:
zimbra@srvXXXX:~$ cat /etc/resolv.conf
nameserver 95.xxx.xx.xx
dig domain.net mx
Code:
root@srvXXXX:~# dig domain.net

; <<>> DiG 9.4.2-P2 <<>> domain.net
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 18276
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.net.			IN	A

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Tue May 18 12:56:45 2010
;; MSG SIZE  rcvd: 28
dig domain.net any
Code:
root@srvXXXX:~# dig domain.net any

; <<>> DiG 9.4.2-P2 <<>> domain.net any
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 18697
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.net.			IN	ANY

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Tue May 18 12:58:01 2010
;; MSG SIZE  rcvd: 28
dig domain.de mx
Code:
root@srvXXXX:~# dig domain.de mx

; <<>> DiG 9.4.2-P2 <<>> domain.de mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 1597
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.de.			IN	MX

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Tue May 18 12:59:10 2010
;; MSG SIZE  rcvd: 27
dig domain.de any
Code:
root@srvXXXX:~# dig domain.de any

; <<>> DiG 9.4.2-P2 <<>> domain.de any
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 36881
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.de.			IN	ANY

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Tue May 18 12:59:55 2010
;; MSG SIZE  rcvd: 27
hosts `hostname`
Code:
zimbra@srvXXXX:~$ host `hostname`
srvXXXX.domain.tld has address 95.xxx.xx.xx
nslookup domain.net
Code:
root@srvXXXX:~# nslookup domain.net
Server:		95.XXX.XX.XX
Address:	95.XXX.XX.XX#53

** server can't find domain.net: SERVFAIL
nslookup domain.de
Code:
root@srvXXXX:~# nslookup domain.de 
Server:		95.XXX.XX.XX
Address:	95.XXX.XX.XX#53

** server can't find domain.de: SERVFAIL
Here the configuration files:

/etc/bind/named.conf.options
Code:
options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you might need to uncomment the query-source
        // directive below.  Previous versions of BIND always asked
        // questions using port 53, but BIND 8.1 and later use an unprivileged
        // port by default.

        // query-source address * port 53;

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

         forwarders {
         80.XXX.XXX.XXX; 145.XXX.XXX.XXX;
         };

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};
/etc/resolv.conf (Die IP ist die externe ServerIP)
Code:
Nameserver 95.XXX.XX.XX
/etc/bind/named.conf.local
Code:
//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

        zone "domain.net" {
                type master;
                file "/etc/bind/db.domain.net";
        };

        zone "domain.de" {
                type master;
                file "/etc/bind/db.domain.de";
        };

        # Reverse DNS
        zone "XX.XX.XXX.95.in-addr.arpa" {
                type master;
                file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
        };
/etc/bind/db.domain.net
Code:
;
; BIND data file for domain.net
;
$TTL    604800
@       IN      SOA     mail.domain.net. admin.domain.net. (
                         070725         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      srvXXXX.provider.tld
        IN      A       95.XXX.XX.XX
mail    IN      A       95.XXX.XX.XX
/etc/bind/db.domain.de
Code:
;
; BIND data file for domain.de
;
@       IN      SOA     mail.domain.de. admin.domain.de. (
                         070725         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      srvXXXX.provider.tld
        IN      A       95.XXX.XX.XX
mail    IN      A       95.XXX.XX.XX
/etc/hosts
Code:
127.0.0.1       localhost.localdomain   localhost
95.XXX.XX.XX    srvXXXX.provider.tld       srvXXXX
Thanks a lot in advance for any help.
Best regards
Reply With Quote
  #2 (permalink)  
Old 05-18-2010, 07:37 AM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

So what exactly is the domain name on your server, you seem to be using three different ones? WHy are you using "provider.tld" when it should be your domain name.

These redords:

Code:
        IN      MX      srvXXXX.provider.tld
        IN      A       95.XXX.XX.XX
mail    IN      A       95.XXX.XX.XX
should look like this:

Code:
        IN      MX      srvXXXX.provider.tld.
        IN      A       95.XXX.XX.XX
srvXXXX.provider.tld.    IN      A       95.XXX.XX.XX
Note the additional period '.' at the end of the FQDN and I prefer the A record to have the full FQDN of the server. These instructions are documented in the Split DNS article in the wiki.
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 05-19-2010, 03:54 AM
Intermediate Member
 
Posts: 21
Default

I have 2 domains - domain.net and domain.de which I wanted both to lead to zimbra. The third domain is the domain the provider gave me for the server, to be quite honest I don't know why I left it in the configuration, probuably because I'm still not familiar enough with everything around the IP and Domain Setup - but I changed that now and substituted it with the proper domain names.
What I did now was change:

/etc/bind/db.domain.net
Code:
;
; BIND data file for domain.net
;
$TTL    604800
@       IN      SOA     mail.domain.net. admin.domain.net. (
                         100519         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      domain.net.
        IN      A       95.XXX.XX.XX
domain.net.    IN      A       95.XXX.XX.XX
db.domain.de
Code:
;
; BIND data file for domain.de
;
@       IN      SOA     mail.domain.de. admin.domain.de. (
                         100519         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      domain.de.
        IN      A       95.XXX.XX.XX
domain.de.    IN      A       95.XXX.XX.XX
and /etc/hosts
Code:
127.0.0.1       localhost.localdomain   localhost
95.XXX.XX.XX    mail.domain.net         mail
I increased the serial numbers and restarted bind but I still don't get proper MX results for "dig domain.net":
Code:
root@srvXXXX:~# dig domain.net

; <<>> DiG 9.4.2-P2 <<>> domain.net
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 31981
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.net.			IN	A

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Wed May 19 10:52:11 2010
;; MSG SIZE  rcvd: 28
Is it possible that there is a mistake in the zone configuration for the 2 domains?
Thanks for all the help so far.
Reply With Quote
  #4 (permalink)  
Old 05-19-2010, 04:04 AM
Moderator
 
Posts: 7,928
Default

Code:
;
; BIND data file for domain.net
;
$TTL    604800
@       IN      SOA     mail.domain.net. admin.domain.net. (
                         100519         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      mail
mail    IN      A       95.XXX.XX.XX
        IN      A       95.XXX.XX.XX
and for domain.de point the MX record at mail.domain.net. as that is the primary serving Zimbra.
__________________
Reply With Quote
  #5 (permalink)  
Old 05-19-2010, 04:34 AM
Intermediate Member
 
Posts: 21
Default

I adjusted the files:

db.domain.net
Code:
;
; BIND data file for domain.net
;
$TTL    604800
@       IN      SOA     mail.domain.net. admin.domain.net. (
                         100520         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      mail
mail    In      A       95.XXX.XX.XX
        IN      A       95.XXX.XX.XX
db.domain.de
Code:
;
; BIND data file for domain.de
;
@       IN      SOA     mail.domain.de. admin.domain.de. (
                         100520         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      mail
        IN      MX      mail.domain.net.
mail    IN      A       95.XXX.XX.XX
        IN      A       95.XXX.XX.XX
restarted bind, dig record still looks like this:
Code:
root@srvXXXX:~# dig domain.net

; <<>> DiG 9.4.2-P2 <<>> domain.net
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 56604
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.net.			IN	A

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Wed May 19 11:32:56 2010
;; MSG SIZE  rcvd: 28
Reply With Quote
  #6 (permalink)  
Old 05-19-2010, 04:45 AM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

Make the following changes, these lines:

Code:
@       IN      NS      mail
        IN      MX      mail.domain.net.
mail    IN      A       95.XXX.XX.XX
        IN      A       95.XXX.XX.XX
to this:

Code:
@       IN      NS      x.x.x.x <- IP address of server (never use the hostname)
        IN      MX      mail.domain.net.
mail.domain.net.    IN      A       95.XXX.XX.XX
        IN      A       95.XXX.XX.XX
When you've done that and restarted bind post the output of all the commands I asked your for earlier.
__________________
Regards


Bill
Reply With Quote
  #7 (permalink)  
Old 05-19-2010, 05:38 AM
Moderator
 
Posts: 7,928
Default

For reference there is no need to specify the FQDN for MX or A records when you wish to use the domain of the zone. For which the domain.net you can set either
Code:
IN MX mail
or
Code:
IN MX mail.domain.net.
As Phoenix has said the '.' is very important if using the second scheme. For domain.de you would always need to specify the FQDN so that it can find mail.domain.net. With regards to why your dig was not reporting anything is due to you not saying what to look for eg. dig domain.net mx
__________________
Reply With Quote
  #8 (permalink)  
Old 05-19-2010, 06:46 AM
Intermediate Member
 
Posts: 21
Default

I decided to go with mail.domain.net. if it works both ways then i'd rather have the files similar for simplicity.

db.domain.net
Code:
;
; BIND data file for domain.net
;
$TTL    604800
@       IN      SOA     mail.domain.net. admin.domain.net. (
                         100522         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      95.XXX.XX.XX
        IN      MX      mail.domain.net.
mail.domain.net.    IN      A       95.XXX.XX.XX  
        IN      A       95.XXX.XX.XX
db.domain.de
Code:
;
; BIND data file for domain.de
;
@       IN      SOA     mail.domain.de. admin.domain.de. (
                         100523         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800         ; Negative Cache TTL
                        )
;
@       IN      NS      95.XXX.XX.XX
        IN      MX      mail.domain.net.
mail.domain.net.    IN      A       95.XXX.XX.XX
        IN      A       95.XXX.XX.XX
@phoenix I read back but couldn't find you asking for any commands? But if you ment the "dig mx/any" commands:

dig domain.net mx
Code:
root@srvXXXX:~# dig domain.net mx

; <<>> DiG 9.4.2-P2 <<>> domain.net mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 62095
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.net.			IN	MX

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Wed May 19 13:41:02 2010
;; MSG SIZE  rcvd: 28
dig domain.net any
Code:
root@srvXXXX:~# dig domain.net any

; <<>> DiG 9.4.2-P2 <<>> domain.net any
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 15690
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.net.			IN	ANY

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Wed May 19 13:41:28 2010
;; MSG SIZE  rcvd: 28
dig domain.de mx
Code:
root@srvXXXX:~# dig domain.de mx

; <<>> DiG 9.4.2-P2 <<>> domain.de mx
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 55811
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.de.			IN	MX

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Wed May 19 13:42:01 2010
;; MSG SIZE  rcvd: 27
dig domain.de any
Code:
root@srvXXXX:~# dig domain.de any

; <<>> DiG 9.4.2-P2 <<>> domain.de any
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 37252
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;domain.de.			IN	ANY

;; Query time: 0 msec
;; SERVER: 95.XXX.XX.XX#53(95.XXX.XX.XX)
;; WHEN: Wed May 19 13:42:25 2010
;; MSG SIZE  rcvd: 27
nslookup domain.net
Code:
root@srvXXXX:~# nslookup domain.net
Server:		95.XXX.XX.XX
Address:	95.XXX.XX.XX#53

** server can't find domain.net: SERVFAIL
I compared it to before when phoenix said that there was something wrong with the DNS A and MX records but nothing changed?
Also what worried me a bit is the output of "nslookup domain.net"

Thanks again for your help so far.
Reply With Quote
  #9 (permalink)  
Old 05-19-2010, 06:53 AM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

Quote:
Originally Posted by Chodid View Post
@phoenix I read back but couldn't find you asking for any commands? But if you ment the "dig mx/any" commands:
Sorry, I meant the command you'd run earlier.

Well as you say, nothing has changed. Can you send me the IP address of the DNS server and the correct domain name so I can check your settings?
__________________
Regards


Bill
Reply With Quote
  #10 (permalink)  
Old 05-19-2010, 08:34 AM
Zimbra Consultant & Moderator
 
Posts: 20,313
Default

OK, so your external DNS records look correct for both domains and they resolve to the correct IP address. Next question(s):

  1. is this server on a public IP (the 95.x.x.x shown in this thread)?
  2. your resolv.conf has the 95.x.x.x as it's DNS server, is that correct?
  3. when you ran the dig commands were they run on the Zimbra server?
  4. just out of interest, which operating system is this?
  5. have you disabled selinx/apparmor and the firewall on this server?
  6. is this server actually behind any firewall or NAT router?
  7. is the Zimbra server currently up and all services running?
__________________
Regards


Bill
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.