problema de DNS? Eu não posso pingar o FQDN, mas eu posso pingar alias (CNAME)

1

Estou a experimentar um problema estranho no DNS e fiquei a pensar se alguém tem alguma ideia:

# 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
#

meu /etc/resolv.conf :

$ cat /etc/resolv.conf 
search XXX.local
nameserver 10.52.223.41
nameserver 10.52.223.42
$ 

meu /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

# 
    
por alexus 18.02.2014 / 18:48

3 respostas

3

Se você tem mdns4_minimal [NOTFOUND=return] no seu nsswitch.conf , isso é certamente porque você tem o daemon Avahi em execução no seu sistema.

Avahi usa DNS multicast para .local zone, o que o torna incompatível com o DNS que suporta apenas DNS unicast para a zona .local . (por exemplo, o DNS da Microsoft suporta apenas o Unicast DNS para a .local zone).

Em tal configuração de rede (onde o DNS suporta somente unicast para .local zone), Avahi recomenda não usar Avahi .

No entanto, eles fornecem algumas soluções:

Remova mdns4_minimal [NOTFOUND=return] de nsswitch.conf para finalmente ter algo parecido com isto:

hosts: files dns mdns4

Mas o principal conselho é configurar avahi-daemon.conf desse modo para evitar o DNS de multidifusão para .local zone:

domain-name=.alocal

Para resolver seu problema:

  • desligue o daemon Avahi

OR

  • Configure seu nsswitch.conf de acordo com as recomendações:

hosts: files dns mdns4

OR

  • Configure seu avahi-daemon.conf de acordo com as recomendações:

domain-name=.alocal

Leitura adicional:

por 18.02.2014 / 22:58
2

adere a @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
# 

Eu REALMENTE quero entender PORQUÊ embora ...

    
por 18.02.2014 / 22:04
1

Modifique seu nsswitch.conf. Mude a linha

hosts: files mdns4_minimal [NOTFOUND=return] dns

para

hosts: files dns

mdns4_minimal [NOTFOUND = return] afeta os domínios .local e não permite atingir o nível "dns". Então eu acho que fazendo a mudança acima, a resolução deve funcionar.

    
por 18.02.2014 / 21:46