如何在/etc/hosts里面包含另外一个文件 hosts文件是不允许包含其他文件的,但是可以通过其他方案实现: 脚本合并方法 保存一个hosts.base一个hosts.local,然后通过脚本合并成为hosts文件 搭建本地私有dns服务器 通过bind搭建私有服务器 运维工具同步 通过pssh, ansible 等运维工具同步配置,可以和方法一一起用 参考 How To Configure BIND as a Private Network DNS Server on Ubuntu 18.04 Is it possible for /etc/hosts to include a file from my home directory?