Centos
Centos7 虛擬機從哪裡獲取本地主機名的 IP 地址?
在我的 centos7 虛擬機上,
hostname
說bmargulies-centos7
,domainname
說(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 伺服器。