你问的“测试 Debian 域名”可能有几种不同含义,下面我分情况给你说明,你可以对照自己的需求来看。
hostname
或
cat /etc/hostname
Debian 的域名通常在:
cat /etc/hosts
cat /etc/resolv.conf
示例 /etc/hosts:
127.0.0.1 localhost
192.168.1.10 debian.example.com debian
ping debian
ping debian.example.com
如果能通,说明本机域名配置正常。
nslookup example.com
或
dig example.com
ping example.com
cat /etc/resolv.conf
应有类似:
nameserver 8.8.8.8
假设你装了 bind9:
systemctl status bind9
dig @127.0.0.1 yourdomain.com
nslookup yourdomain.com <Debian服务器IP>
curl http://yourdomain.com
或
wget https://yourdomain.com
也可在浏览器中访问域名。
ip a
ping 8.8.8.8
systemctl restart networking
systemctl restart bind9
journalctl -u bind9
如果你能补充说明:
我可以给你更精确的测试步骤。