O Debian não pode resolver nomes de host

7

Eu tenho um problema para resolver nomes de host no Debian rodando em vmware.

Parou de funcionar do nada. Algum lugar depois de desinstalar o servidor percona e excluir o / etc / mysql. Inicialmente, pensava-se que era um problema com a rede quando o host estava dormindo enquanto o guest estava sendo executado, o que é um problema conhecido do vmware. Mas não pode ser.

Debian 7.4, ferramentas vmware instaladas

/etc/reslov.conf

# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

ping, dig e saída do nsloopup

ivar@debian:~$ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=47 time=40.0 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=47 time=39.7 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 39.747/39.874/40.001/0.127 ms
ivar@debian:~$ dig google.com

; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18895
;; flags: qr rd ra; QUERY: 1, ANSWER: 11, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     299 IN  A   173.194.113.100
google.com.     299 IN  A   173.194.113.99
google.com.     299 IN  A   173.194.113.96
google.com.     299 IN  A   173.194.113.103
google.com.     299 IN  A   173.194.113.110
google.com.     299 IN  A   173.194.113.102
google.com.     299 IN  A   173.194.113.98
google.com.     299 IN  A   173.194.113.105
google.com.     299 IN  A   173.194.113.97
google.com.     299 IN  A   173.194.113.101
google.com.     299 IN  A   173.194.113.104

;; Query time: 43 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Mar 29 18:46:07 2014
;; MSG SIZE  rcvd: 204

ivar@debian:~$ nslookup google.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   google.com
Address: 173.194.113.97
Name:   google.com
Address: 173.194.113.104
Name:   google.com
Address: 173.194.113.101
Name:   google.com
Address: 173.194.113.99
Name:   google.com
Address: 173.194.113.100
Name:   google.com
Address: 173.194.113.96
Name:   google.com
Address: 173.194.113.102
Name:   google.com
Address: 173.194.113.103
Name:   google.com
Address: 173.194.113.110
Name:   google.com
Address: 173.194.113.105
Name:   google.com
Address: 173.194.113.98

ivar@debian:~$ ping google.com
ping: unknown host google.com

Alguma ideia de como resolver este problema?

/etc/nsswitch.conf

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the 'glibc-doc-reference' and 'info' packages installed, try:
# 'info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files mdns4_minimal wins [NOTFOUND=return] dns mdns4
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
    
por Ivarpoiss 29.03.2014 / 17:48

1 resposta

5

Com seu nsswitch.conf atual, o dns só será solicitado se uma solicitação de wins falhar. Aqui estão os trechos relevantes da página nsswitch.conf no meu sistema:

notfound
The lookup succeeded, but the requested entry was not found. The default action for this condition is "continue".

return
Return a result now. Do not call any further lookup functions.

No seu exemplo, você consultou com êxito o WINS, mas não recuperou um resultado para google.com . Para corrigir isso, você pode remover o [NOTFOUND=return] ou reordenar os serviços consultados para a pesquisa de host. Aqui está um exemplo de correção:

hosts:          files mdns4_minimal dns wins [NOTFOUND=return] mdns4
    
por 29.03.2014 / 19:30