在我的 Ubuntu 12.4 上,这些工作正常:
$ hostname
my-machine-XX
ping `hostname`
ping my-machine-xx (192.168.0.69) icmp_req=1 ttk=64 time=0.043 ms
Run Code Online (Sandbox Code Playgroud)
但 host 和 nslookup 返回错误的 IP 地址:
$ host my-machine-xx
my-machine-xx has address 198.105.244.23
my-machine-xx has address 198.105.254.23
Host my-machine-xx not found: 3(NXDOMAIN)
$ nslookup my-machine-xx
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
Name: my-machine-xx
Address: 198.105.244.23
Name: my-machine-xx
Address: 198.105.254.23
Run Code Online (Sandbox Code Playgroud)
我很感激有关如何修复它的帮助。谢谢。
dns ×1