情况:我们曾经(现在仍然部分)使用一个域名(dark.void
),我们希望摆脱它!以下是尝试切换到新space.opened
域名时不同网络配置文件的当前内容...
/etc/hosts
127.0.0.1 localhost
127.0.1.1 supernova.space.opened supernova
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
PS:我supernove.space.opened
根据以下内容将如何在 12.04 中设置完全限定域名?,但无济于事,即使重新启动后......
/etc/主机名
supernova
/etc/网络/接口
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
自网络管理器配置后未使用...
/etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search space.opened space.damned space.warped dark.void dust.hidden
我在本地运行 bind9 来在部署之前测试 DNS 更改......
...
那么为什么hostname -A
仍然给我supernova.dark.void
而不是supernova.space.opened
?
答案1
... 如上所述阿多尼斯在评论中,我忽略了 1.168.192.in-addr.arpa DNS 区域中主机的记录!更正后,一切看起来都很好:
前...
nulinflux@supernova:~$ dig -x 192.168.1.254
;; ANSWER SECTION:
254.1.168.192.in-addr.arpa. 259200 IN PTR supernova.dark.void.
后...
nulinflux@supernova:~$ dig -x 192.168.1.254
;; ANSWER SECTION:
254.1.168.192.in-addr.arpa. 259200 IN PTR supernova.space.opened.
nulinflux@supernova:~$ 主机名 -A
supernova.space.opened
案子结了!