解决我的本地主机名(由hostname
返回的那个)不会产生正确的IP地址。为什么会这样,我该如何解决?`hostname -i`地址不同于`ifconfig`地址
$ hostname -i
10.21.16.206
$ ping 10.21.16.206
PING 10.21.16.206 (10.21.16.206) 56(84) bytes of data.
From 10.21.16.159 icmp_seq=1 Destination Host Unreachable
$ ifconfig
(...)
inet 10.21.16.159 netmask 255.255.252.0 broadcast 10.21.19.255
(...)
10.21.16.206!= 10.21.16.159
$ host 10.21.16.159
Host 159.16.21.10.in-addr.arpa. not found: 3(NXDOMAIN)
$ host 10.21.16.206
206.16.21.10.in-addr.arpa domain name pointer lxka-czc1166cxw.united.domain.
$ resolveip 10.21.16.159
Host name of 10.21.16.159 is lxka-czc1166cxw
$ resolveip 10.21.16.206
Host name of 10.21.16.206 is lxka-czc1166cxw.united.domain
帮助非常感谢!
编辑:
$ host $(hostname)
lxka-czc1166cxw.united.domain has address 10.21.16.206
将'host $(hostname)'的输出添加到您的问题中。 – Cyrus
完成:lxka-czc1166cxw.united.domain的地址是10.21.16.206 – Nicola