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

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 09-26-2008, 01:48 PM
Loyal Member
 
Posts: 76
Default [SOLVED] DNS won't resolve localhost

Hi all,

Here I am again and guess what, I am still stuck with the usual NAT/DNS, although this seems to be purely a DNS problem.

Here is what I get when I try and resolve localhost:

Code:
# host localhost
localhost.mydomain.com does not exist (Authoritative answer)
mailq
Code:
253A47C3C9     3962 Fri Sep 26 20:19:28  john@mydomain.com
(Host or domain name not found. Name service error for name=localhost type=A: Host not found)
                                         frank@gmail.com
So I thought I'd add a dirty little hack

db.mydomain
Code:
localhost   IN A        127.0.0.1
and it looked good

Code:
# host localhost
localhost.mydomain.com A       127.0.0.1
until I saw the mailq:

mailq
Code:
70D3E7C3CF     4830 Fri Sep 26 20:34:32  john@mydomain.com
                                     (mail for localhost loops back to myself)
                                         frank@gmail.com
Can anyone help me solve this... I am going round in circles.

The DNS is on the zimbra server and the important configs are as follow.

db.local
Code:
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      localhost.
@       IN      A       127.0.0.1
db.127
Code:
$TTL    604800
@       IN      SOA     localhost. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@                       IN              NS              localhost.
1.0.0   IN      PTR   localhost.
db.mydomain.com
Code:
$TTL    604800
@       IN      SOA     mail.mydomain.com. hostmaster.mydomain.com. (
           2008092607           ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
                        IN              NS              mail.mydomain.com.
                        IN              MX 10           mail.mydomain.com.
mail                    IN              A                       10.0.0.1
I think this is something obvious but I have been at it for too long.

Any help would be much appreciated.

PS: "order hosts,dns" didin't help.

Thanks
-eco
Reply With Quote
  #2 (permalink)  
Old 09-26-2008, 05:33 PM
Intermediate Member
 
Posts: 15
Default

Did you already check /etc/hosts? It should look like this:

127.0.0.1 localhost
122.0.1.1 computer01.monster.grouop computer01

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Reply With Quote
  #3 (permalink)  
Old 09-26-2008, 09:32 PM
Active Member
 
Posts: 33
Default

Actually it should be like this:

127.0.0.1 localhost.localdomain localhost
x.x.x.x mail.mydomain.com myhostname

Just replace x.x.x.x with your host's IP address, mail.mydomain.com with the fully-qualified name of your host and myhostname with your box's hostname.

One more thing: the line which has 127.0.0.1 has to stay like that (exactly).

Best regards,

Sergio Aguayo
Reply With Quote
  #4 (permalink)  
Old 09-26-2008, 10:46 PM
Loyal Member
 
Posts: 76
Default

Hi guys,

Sorry for the late reply but time zones can do that

This is my host file:

/etc/hosts
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain localhost
10.0.0.1        mail.mydomain.com
It all good right? It's local IP is 10.0.0.1 which is of course NATed.

I put my DNS logs into overdrive but get very little information:

Code:
# host localhost
localhost.mydomain.com does not exist (Authoritative answer)
gives me
Code:
==> /var/log/named/queries.log <==
27-Sep-2008 05:41:04.542 client 127.0.0.1#32817: query: localhost.mydomain.com IN A +
Any thoughts? I'll soon be uninstalling the whole bind server and reinstalling it bit by bit.

Thanks for your help.
-eco
Reply With Quote
  #5 (permalink)  
Old 09-26-2008, 10:52 PM
Active Member
 
Posts: 33
Default

Hi

Don't forget to add your hostname after your FQDN. Also, localhost.mydomain.com isn't supposed to be resolved by the DNS server, but by the /etc/hosts file. Maybe adding your hostname as mentioned here could solve the problem.

Best regards,

Sergio Aguayo
Reply With Quote
  #6 (permalink)  
Old 09-26-2008, 11:45 PM
Loyal Member
 
Posts: 76
Default

sergioag - Thanks for the hint on the hosts file, completely missed the missing host!


OK, so I decided to go back to basics and removed the DNS server from the zimbra server and customed the hosts file as proposed

/etc/hosts
Code:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1       localhost.localdomain   localhost
127.0.0.1       localhost.mydomain.com localhost
10.0.0.1    mail.mydomain.com          mail
Now, on zimbra, when I run the following I get
Code:
# host localhost
localhost.mydomain.com CNAME   mydomain.com
mydomain.com           A       60.25.29.100
so I did a tcpdump from the firewall and sure enough it goes out of it's way to ask someone other than my hosts file
Code:
08:38:14.516591 IP 10.0.0.1.32823 > 213.186.33.99.53:  6057+ A? localhost.mydomain.com. (41)
08:38:14.516997 IP 213.186.33.99.53 > 10.0.0.1.32823:  6057 2/5/5 CNAME[|domain]
08:38:14.517181 IP 10.0.0.1.32823 > 213.186.33.99.53:  10089+ A? mydomain.com. (31)
08:38:14.517531 IP 213.186.33.99.53 > 10.0.0.1.32823:  10089 1/5/5 A 60.25.29.100 (229)
A ping does the job.
Code:
# ping localhost -c 1
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.010 ms
Although host is a DNS command and thus, should probably query only DNSs and not the hosts file, I still think something somewhere in my network configuration is wrong.

How did you (all the people using nated environments with zimbra) have bind/hosts setup?

Thanks
-eco
Reply With Quote
  #7 (permalink)  
Old 09-27-2008, 12:05 AM
Loyal Member
 
Posts: 76
Default

A little update that seems to confirm a problem with my network settings and my wrong assumption that host only deals with DNS.

Code:
# host localhost
localhost has address 127.0.0.1

fw # ps -ef |grep named
bind      2943     1  0 Sep26 ?        00:00:00 /usr/sbin/named -u bind
root      3205  3194  0 08:58 pts/3    00:00:00 grep named

fw # /etc/init.d/bind9 stop
Stopping domain name service...: bind.

fw # host localhost
localhost has address 127.0.0.1
Wish me luck
Reply With Quote
  #8 (permalink)  
Old 09-27-2008, 01:59 AM
Loyal Member
 
Posts: 76
Default

Hi all,

I ended up solving the problem, but first a bit of fun:

dig gives me:
Code:
# dig localhost
; <<>> DiG 9.3.4-P1.1 <<>> localhost
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48520
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;localhost.                     IN      A

;; ANSWER SECTION:
localhost.              604800  IN      A       127.0.0.1

;; AUTHORITY SECTION:
localhost.              604800  IN      NS      localhost.

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Sat Sep 27 08:51:38 2008
;; MSG SIZE  rcvd: 57
while host gives me:
Code:
# host localhost
localhost.mydomain.com does not exist (Authoritative answer)
Any one have a clue why that is. Host was leading me to believe the DNS had a problem while it seems it's host that has one.

I solved my problem by setting the Global and Server MTA settings to localhost.

I had changed these at first whilst in the euphoria of my new mail server thinking I was doing well to put mail.mydomain.com instead of localhost.

Thank you all for your help!
-eco
Reply With Quote
  #9 (permalink)  
Old 09-27-2008, 09:40 AM
Elite Member
 
Posts: 380
Default

Thanks for posting the details of your [SOLUTION]. :-)
__________________
Jay R. Ashworth - ZCS 6.0.9CE/CentOS5 - St Pete FL US - Music - Blog - Photography - IANAL - IAAMA
Try to Ask Questions The Smart Way -- you'll get better answers.

Put your product and version in your profile/signature - All opinions strictly my own, even though I have an employer these days.
If you [SOLVE] something, please tell everyone how for the archives
And, please... read what people write, and answer the questions they asked, not the ones they didn't.
Reply With Quote
  #10 (permalink)  
Old 09-28-2008, 09:31 AM
Loyal Member
 
Posts: 76
Default

Quote:
Originally Posted by Baylink View Post
Thanks for posting the details of your [SOLUTION]. :-)
It's all about open source and giving back what you can init
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

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.