Results 1 to 10 of 10

Thread: [SOLVED] DNS won't resolve localhost

  1. #1
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    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

  2. #2
    Join Date
    Aug 2008
    Posts
    15
    Rep Power
    7

    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

  3. #3
    Join Date
    Nov 2007
    Location
    Lima-Peru
    Posts
    33
    Rep Power
    8

    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

  4. #4
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    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

  5. #5
    Join Date
    Nov 2007
    Location
    Lima-Peru
    Posts
    33
    Rep Power
    8

    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

  6. #6
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    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

  7. #7
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    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

  8. #8
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    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

  9. #9
    Join Date
    Aug 2008
    Location
    St Pete FL USA
    Posts
    392
    Rep Power
    7

    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.

  10. #10
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    91
    Rep Power
    7

    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

Similar Threads

  1. Self-Signed SSL Certificate Causing Crash
    By VxJasonxV in forum Administrators
    Replies: 1
    Last Post: 12-06-2007, 01:24 PM
  2. Why is Tomcat shuting down ever nights?
    By trapanator in forum Administrators
    Replies: 2
    Last Post: 11-30-2006, 11:57 PM
  3. fetchmail: SMTP< 250 Ok: queued as
    By daly1 in forum Installation
    Replies: 4
    Last Post: 08-04-2006, 05:23 AM
  4. Is it started or not
    By kwelipatton in forum Installation
    Replies: 10
    Last Post: 03-28-2006, 11:11 PM
  5. emails don't show up in inbox in browser
    By pstelzer in forum Installation
    Replies: 10
    Last Post: 12-13-2005, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •