我最近安装了 Raspberry Pi Ubuntu Server 22.04.3 LTS(64 位)映像及其映像工具:
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
# hostnamectl
Static hostname: apollo
Icon name: computer
Machine ID: f1d5fae30ffc434680ebcb59c2f5a582
Boot ID: af1da6b8a7384f5fa5b35896935dfbf6
Operating System: Ubuntu 22.04.3 LTS
Kernel: Linux 5.15.0-1044-raspi
Architecture: arm64
# resolvectl status
Global
Protocols: -LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Link 2 (eth0)
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 192.168.4.1
DNS Servers: 192.168.4.1
DNS Domain: lan
# cat /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search lan
我在 Ubuntu 中遇到了与 FQDN 相关的奇怪行为,这是我在 Debian 中从未遇到过的:
# hostname --short
apollo
# hostname --fqdn
apollo
# hostname --all-fqdns
apollo.lan
# cat /etc/hosts | grep 127.0.1.1
127.0.1.1 apollo apollo
如上所示,在安装过程中,FQDN 设置错误,--all-fqdns
反向 DNS 查找返回正确值,因为也在查找192.168.4.1
。目前,我手动编辑了/etc/hosts
:
# cat /etc/hosts | grep 127.0.1.1
127.0.1.1 apollo.lan apollo
我正在尝试确定该问题的正确解决方法,感谢您的帮助。