Centos

Centos7 虛擬機從哪裡獲取本地主機名的 IP 地址?

  • May 21, 2016

在我的 centos7 虛擬機上,hostnamebmargulies-centos7domainname(none)dig bmargulies-centos7說下面的內容,並且對該主機名的 ping 掛起。IP地址92.242.140.21從哪裡來?

; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7_2.3 <<>> bmargulies-centos7
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55643
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:
; MBZ: 0005 , udp: 4096
;; QUESTION SECTION:
;bmargulies-centos7.        IN  A

;; ANSWER SECTION: bmargulies-centos7.  5   IN  A   92.242.140.21

;; Query time: 29 msec
;; SERVER: 192.168.74.2#53(192.168.74.2)
;; WHEN: Sat May 21 14:04:49 EDT 2016
;; MSG SIZE  rcvd: 63

它來自您提供商的內部 DNS 伺服器 192.168.74.2。

/etc/resolv.conf除非您已經bind在您的機器上執行,否則很可能已配置了該 DNS 伺服器。

引用自:https://unix.stackexchange.com/questions/284657