Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm experencing weird DNS issue and I was wondering if someone has any ideas:

# ping -c1 test.XXX.local
ping: unknown host test.XXX.local
# ping -c1 test
PING test.XXX.local ( 56(84) bytes of data.
64 bytes from test.XXX.local ( icmp_seq=1 ttl=63 time=0.307 ms

--- test.XXX.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.307/0.307/0.307/0.000 ms

my /etc/resolv.conf:

$ cat /etc/resolv.conf 
search XXX.local

my /etc/hosts:

# cat /etc/hosts   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

dig output:

# dig test.XXX.local @

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> test.XXX.local @
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25966
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;test.XXX.local.        IN  A

test.XXX.local. 86400   IN  A

XXX.local.      86400   IN  NS  ns01.XXX.local.
XXX.local.      86400   IN  NS  ns02.XXX.local.

ns02.XXX.local. 1200    IN  A

;; Query time: 0 msec
;; WHEN: Tue Feb 18 13:14:16 2014
;; MSG SIZE  rcvd: 105



# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
# Valid entries include:
#   nisplus         Use NIS+ (NIS version 3)
#   nis         Use NIS (NIS version 2), also called YP
#   dns         Use DNS (Domain Name Service)
#   files           Use the local files
#   db          Use the local database (.db) files
#   compat          Use NIS on compat mode
#   hesiod          Use Hesiod for user lookups
#   [NOTFOUND=return]   Stop searching if not found so far

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files
shadow:     files
group:      files

#hosts:     db files nisplus nis dns
hosts:      files mdns4_minimal [NOTFOUND=return] dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files     

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files
rpc:        files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:    files nisplus

share|improve this question
Could you put the /etc/hosts content and the results of the dig commands: dig @ test.XXX.local dig @ test.XXX.local –  Adrian Perez Feb 18 '14 at 17:56
@alexus No, Adrian Perez asked you to update your question by providing your /etc/hosts file content and some dig output !!! To help us debug –  krisFR Feb 18 '14 at 18:11
@alexus sorry.. it's my bad english i want you to paste the contents of the /etc/hosts to see the records there.. Launch the dig commands to see if the dns servers resolve right (paste the results..) –  Adrian Perez Feb 18 '14 at 18:13
@alexus Can you also post the content of your /etc/nsswitch.conf ? –  krisFR Feb 18 '14 at 18:46
@user2196728 done –  alexus Feb 18 '14 at 20:10

3 Answers 3

props to @guntbert

# service avahi-daemon stop
Shutting down Avahi daemon:                                [  OK  ]
# ping test.XXX.local
PING test.XXX.local ( 56(84) bytes of data.
64 bytes from test.XXX.local ( icmp_seq=1 ttl=63 time=1.15 ms
--- test.XXX.local ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 625ms
rtt min/avg/max/mdev = 1.152/1.152/1.152/0.000 ms
# chkconfig avahi-daemon off

I REALLY wish to understand WHY? though...

share|improve this answer
This has to deal with unicast and multicast DNS. Here is the "why?" : lowlevelmanager.com/2011/09/… To resume, it seems you use Microsoft DNS and .local zones only support unicast DNS. Avahi provide multicast DNS –  krisFR Feb 18 '14 at 21:18
@user2196728 it's still unclear for me due to fact, that /etc/nsswitch.conf & /etc/avahi/avahi-daemon.conf are identical between several machines, yet only one (at least so far) is experiencing this issue while others do not. –  alexus Feb 18 '14 at 21:26
Are Avahi daemons running on your other machines ? –  krisFR Feb 18 '14 at 21:27
@user2196728 yes, it does. that's what really weird... –  alexus Feb 18 '14 at 21:29
Take care that order is very important for the hosts: line in nsswitch.conf ! Are directive in the same order on your others machines ? –  krisFR Feb 18 '14 at 21:36

Modify your nsswitch.conf. Change the line

hosts: files mdns4_minimal [NOTFOUND=return] dns


hosts: files dns

mdns4_minimal [NOTFOUND=return] affects to .local domains and doesn't allow to reach "dns" level. So i think that doing the above change, the resolution should work.

share|improve this answer
I have yet another Linux machine on same network using same DNS w/ same nsswitch.conf and yet everything is working. –  alexus Feb 18 '14 at 21:01

If you have mdns4_minimal [NOTFOUND=return] in your nsswitch.conf this is certainly because you have the Avahi daemon running on your system.

Avahi uses multicast DNS for .local zone, that makes it incompatible with DNS that only supports unicast DNS for zone .local. (e.g Microsoft's DNS only supports Unicast DNS for the .local zone).

In such a network setup (where DNS only supports unicast for .local zone), Avahi recommands to not use Avahi.

However, they provide some workaround :

Remove mdns4_minimal [NOTFOUND=return] from nsswitch.conf to finally have something like this :

hosts: files dns mdns4

But their main advice is to setup avahi-daemon.conf like this to avoid multicast DNS for .local zone :


To solve your issue, either :

  • shutdown the Avahi daemon


  • Set up your nsswitch.conf accordingly to recommendations :

hosts: files dns mdns4


  • Set up your avahi-daemon.conf accordingly to recommendations :


Further reading :

share|improve this answer
1) Actually .41 and .42 are RHEL6 and not Microsoft. 2) after setting domain-name=.alocal avahi-daemon service won't even starts up anymore. –  alexus Feb 20 '14 at 15:58
ok, so your RHEL6s does not seems to support multicast DNS for .local zone, just as Microsoft's ones. For 2) i admit i am not an Avahi expert, i've just read the doc. Have you read carefully my second link ? you could find interesting infos. I've updated my post to extend "my blaming" to not only Microsoft, but more generally the incompatibily between muticast/unicast DNS for .local zone –  krisFR Feb 20 '14 at 17:14
PS : for 2), if Avahi does not strart with .alocal, my guess is because this zone should exists on your DNS. Tou could try to create it first. –  krisFR Feb 20 '14 at 18:08
I have XXX.local zone, not .alocal. –  alexus Feb 20 '14 at 19:19
I know, that is my i've suggested you to also create a .alocal zone to see if Avahi can start when you set it with domain-name=.alocal –  krisFR Feb 20 '14 at 19:20

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.