在 Linux 上仅使用 /etc/hosts 来解析主机名

Mat*_*ias 4 dns hosts

我想通过 DNS 服务器禁用 DNS 查找,并且只解析 /etc/hosts 中列出的主机名。我使用的是 Raspbian 9。我该如何设置?

seb*_*sth 5

主机字段中删除dns/etc/nsswitch.conf

hosts:          files
Run Code Online (Sandbox Code Playgroud)

您可能还想从/etc/resolv.conf.