Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I know this looks like all the other "can ping via ip but not dns" questions, but those didnt really help me at all.

Also, having hosts files in all machines is not doable as this server will eventually handle a lot of computers connecting to it.

I have a ldap+dns server set, and I want the computers on my network to authenticate on the ldap server.

The ldap part of it is working just fine and I can ssh into the ldap server with the ldap credentials just fine.

The problem comes with the client machines, the client is set to use the dns server (in this case and if I get in the terminal and do a nslookup it finds the ldap server just fine.

fernando@desktest:~$ nslookup ldap.mynet.local

Name:   ldap.mynet.local

but when i ping it doesnt find the ip address. just hangs there looking pretty till i CTRL-C it. of course pinging by ip address works just fine.

here are the zone files for the dns server

fernando@ldap:~$ cat /etc/bind/named.conf.local

zone "mynet.local" {
    type master;
    file "/etc/bind/db.mynet.local";

zone "" {
    type master;
    notify no;
    file "/etc/bind/db.192";
fernando@ldap:~$ cat /etc/bind/db.mynet.local 
; BIND data file for local loopback interface
$TTL    604800
@   IN  SOA ns.mynet.local. root.mynet.local. (
                  7     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
         604800 )   ; Negative Cache TTL
@   IN  NS  ns.mynet.local.
ns  IN  A
server  IN  A
desktest    IN  A
remote  IN  A
winserver   IN  A
web         IN  A
tempfs  IN  A
ldap    IN  A
antenarfb   IN  A
antenapan   IN  A
adslgvt IN  A
fernando@ldap:~$ cat /etc/bind/db.192 
; BIND reverse data file for local loopback interface
$TTL    604800
@   IN  SOA mynet.local. root.mynet.local. (
                  6     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
@   IN  NS  ns.
1   IN  PTR ns.mynet.local.
2   IN  PTR server.mynet.local.
3   IN  PTR desktest.mynet.local.
4   IN  PTR remote.mynet.local.
5   IN  PTR winserver.mynet.local.
6   IN  PTR web.mynet.local.
7   IN  PTR tempfs.mynet.local.
8   IN  PTR ldap.mynet.local.
9   IN  PTR antenarfb.mynet.local.
10  IN  PTR antenapan.mynet.local.
11  IN  PTR adslgvt.mynet.local.

I am really at a loss about what to do and any help will be greatly appreciated.

---- edit ----

before anybody asks, yes the server is running :)

root@ldap:/etc/bind# rndc status
version: 9.7.0-P1
CPUs found: 1
worker threads: 1
number of zones: 16
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
recursive clients: 0/0/1000
tcp clients: 0/100
server is up and running

---- end edit ----

share|improve this question
after more testing i am pretty sure i am doing something wrong on the dns server part. doing host ldap gives me a host not found error (even on the dns server terminal) same thing using dig, same thing with host (my ldap.mynet.local machine). – Fernando Nov 22 '11 at 18:47
doing host ldap.mynet.local on the client machine gives me the correct ip address :/ – Fernando Nov 22 '11 at 19:03

2 Answers 2

up vote 28 down vote accepted

I believe this is caused by mdns - multicast dns, for autoconfiguration of the .local domain.

If you check in /etc/nsswitch.conf, you will probably see:

hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4

mdns4 is what is doing multicast dns. Try changing this to:

hosts: files dns

And see if it makes any difference. If it makes it work, you can remove mdns permanently with:

Try apt-get remove libnss-mdns

Which will do the nsswitch.conf change for you as well.

Alternatively, don't use .local - use .lan or something instead.

share|improve this answer
Perfect! worked like a charm! Thank you very much. Reverse DNS is still giving me an error, but that is another issue I guess :) – Fernando Nov 22 '11 at 19:09
Dude, You are amazing !!!!! – Thai Tran Jul 26 '12 at 8:17
This was the actual solution to my issue on Ubuntu Saucy/13.10. – beerbajay Apr 10 '14 at 8:29
Helped a loot, thanks for saving the time – Lonston May 14 '14 at 3:57

Another thing that I have seen interfere with DNS is installing winbind. It seems to put a wins entry before [NOTFOUND=return] in /etc/nsswitch.conf, which causes DNS to fail, but can be fixed by moving wins to after the "NOTFOUND" part, also, preferably after dns so that dns lookup happens first, see this:

(not sure why this happens by default though; comments welcome!)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.