我有 netplan 管理一个简单的网桥,并在同一台服务器上使用 BIND 提供 DNS 服务,除了相对域解析之外,它都运行良好。
host -t A foo
输出:
foo.example.com has address 192.168.0.3
但是host -t A bar.foo
(它是 的别名foo
)输出:
Host bar.foo not found: 3(NXDOMAIN)
即使ping bar.foo
正确解析域别名并输出:
PING foo.example.com (192.168.0.3) 56(84) bytes of data.
我认为这可以通过添加指令ndots:2
来控制,以便第二个查询被视为相对,但当然它不是一个直接可编辑的文件。从 netplan 传递此配置的正确方法是什么?或者还有其他可以指定的地方吗?如果可以避免,我不想制作常规文件。options
/etc/resolv.conf
/etc/resolv.conf
我在resolved.conf 手册页中没有发现任何有用的东西。
/etc/netplan/00-my-config.yaml
:
network:
ethernets:
eno1:
dhcp4: false
dhcp6: false
version: 2
bridges:
br0:
interfaces:
- eno1
addresses:
- 192.168.0.2/24
gateway4: 192.168.0.1
nameservers:
addresses:
- 192.168.0.2
- 192.168.0.1
search:
- example.com
/etc/resolv.conf
:
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 127.0.0.53
options edns0
search example.com