데비안은 호스트 이름을 확인할 수 없습니다

데비안은 호스트 이름을 확인할 수 없습니다

VMWare에서 실행되는 Debian에서 호스트 이름을 확인하는 데 문제가 있습니다.

갑자기 작동이 멈췄습니다. Percona 서버를 제거하고 /etc/mysql.conf를 삭제한 후 처음에는 게스트가 실행 중인 동안 호스트가 절전 모드에 있을 때 VMWare의 알려진 문제인 네트워크 문제인 줄 알았습니다. 그러나 그것은 불가능합니다.

Debian 7.4, VMWare 도구 설치

/etc/resolv.conf

# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4

ping, dig 및 nslookup 출력

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

이 문제를 해결하는 방법에 대한 아이디어가 있습니까?

/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

답변1

현재 nsswitch.confDNS 의 경우 wins요청이 실패한 경우에만 요청됩니다. nsswitch.conf내 시스템의 맨페이지에서 관련 발췌문은 다음과 같습니다 .

notfound
조회에 성공했지만 요청한 항목을 찾을 수 없습니다. 이 조건에 대한 기본 작업은 "계속"입니다.

return은
결과를 즉시 반환합니다. 더 이상 조회 함수를 호출하지 마세요.

귀하의 예에서는 WINS를 성공적으로 쿼리했지만 결과가 검색되지 않았습니다 google.com. 이 문제를 해결하려면 [NOTFOUND=return]호스트 검색을 위해 쿼리된 서비스를 제거하거나 다시 정렬하면 됩니다. 수정 예시는 다음과 같습니다.

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

관련 정보