在Linux中,是否有一种方法可以让DNS客户端在查找DNS名称上的信息时返回一个IP号,即使它不存在?
我正在创建一个测试环境,我希望能够解析不存在的域名。
我知道我可以在主机文件中这样做,但是我不想为我试图查找的每个域名编辑这个文件。
对我的问题的进一步澄清是这样
场景1:我ping google.com dns查找google.com并获得真正的IP编号。
场景2:我ping nonexstiantdoamin.com,它将返回本地IP号,而不是查找失败。
发布于 2017-08-07 16:05:04
看看dnsmasq。它有一个-H选项,允许您添加主机。在其手册页上:
-H, --addn-hosts=<file>
Additional hosts file. Read the specified file as well as
/etc/hosts. If -h is given, read only the specified file. This
option may be repeated for more than one additional hosts file.
If a directory is given, then read all the files contained in
that directory.https://unix.stackexchange.com/questions/384517
复制相似问题