我有一台运行 20.04 的笔记本电脑,希望能够仅通过主机名来寻址网络上的主机,而不必每次都指定完整的 fqdn。以下是我当前的 /etc/netplan/01-network-manager-all.yaml,它似乎不起作用
network:
version: 2
renderer: NetworkManager
ethernets:
wlp2s0:
nameservers:
search: [intern.kepp.tech]
addresses: [192.168.0.6]
我在这里做错了什么? 以下输出说明了我的问题:
root@KTLAPTOP01:~# nslookup klwks01
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find klwks01: SERVFAIL
root@KTLAPTOP01:~# nslookup klwks01.intern.kepp.tech
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: klwks01.intern.kepp.tech
Address: 192.168.0.23
答案1
network:
version: 2
renderer: NetworkManager
ethernets:
wlp2s0:
nameservers:
search: [intern.kepp.tech]
addresses: [192.168.0.6]
应该读
network:
version: 2
renderer: NetworkManager
ethernets:
wlp2s0:
nameservers:
search: ['intern.kepp.tech']
addresses: [192.168.0.6]