1

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 (10.52.223.41) 56(84) bytes of data.
64 bytes from test.XXX.local (10.52.223.41): 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
nameserver 10.52.223.41
nameserver 10.52.223.42
$ 

my /etc/hosts:

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

dig output:

# dig test.XXX.local @10.52.223.41

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> test.XXX.local @10.52.223.41
;; 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

;; QUESTION SECTION:
;test.XXX.local.        IN  A

;; ANSWER SECTION:
test.XXX.local. 86400   IN  A   10.52.223.41

;; AUTHORITY SECTION:
XXX.local.      86400   IN  NS  ns01.XXX.local.
XXX.local.      86400   IN  NS  ns02.XXX.local.

;; ADDITIONAL SECTION:
ns02.XXX.local. 1200    IN  A   10.52.223.42

;; Query time: 0 msec
;; SERVER: 10.52.223.41#53(10.52.223.41)
;; WHEN: Tue Feb 18 13:14:16 2014
;; MSG SIZE  rcvd: 105

# 

/etc/nsswitch.conf

# 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

# 
7
  • Could you put the /etc/hosts content and the results of the dig commands: dig @10.52.223.41 test.XXX.local dig @10.52.223.42 test.XXX.local Feb 18, 2014 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, 2014 at 18:11
  • 1
    @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..) Feb 18, 2014 at 18:13
  • @alexus Can you also post the content of your /etc/nsswitch.conf ?
    – krisFR
    Feb 18, 2014 at 18:46
  • @user2196728 done
    – alexus
    Feb 18, 2014 at 20:10

3 Answers 3

3

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 :

domain-name=.alocal

To solve your issue, either :

  • shutdown the Avahi daemon

OR

  • Set up your nsswitch.conf accordingly to recommendations :

hosts: files dns mdns4

OR

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

domain-name=.alocal


Further reading :

5
  • 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, 2014 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, 2014 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, 2014 at 18:08
  • I have XXX.local zone, not .alocal.
    – alexus
    Feb 20, 2014 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, 2014 at 19:20
2

props to @guntbert

# service avahi-daemon stop
Shutting down Avahi daemon:                                [  OK  ]
# ping test.XXX.local
PING test.XXX.local (10.52.223.42) 56(84) bytes of data.
64 bytes from test.XXX.local (10.52.223.42): icmp_seq=1 ttl=63 time=1.15 ms
^C
--- 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...

9
  • 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, 2014 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, 2014 at 21:26
  • Are Avahi daemons running on your other machines ?
    – krisFR
    Feb 18, 2014 at 21:27
  • @user2196728 yes, it does. that's what really weird...
    – alexus
    Feb 18, 2014 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, 2014 at 21:36
1

Modify your nsswitch.conf. Change the line

hosts: files mdns4_minimal [NOTFOUND=return] dns

to

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.

1
  • I have yet another Linux machine on same network using same DNS w/ same nsswitch.conf and yet everything is working.
    – alexus
    Feb 18, 2014 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .