Centos dnsmasq反向IP地址';如果配置文件中没有ptr记录,则无法工作

Centos dnsmasq反向IP地址';如果配置文件中没有ptr记录,则无法工作,centos,dnsmasq,Centos,Dnsmasq,我的服务器中有dnsmasq设置。出于某些安全原因,我不允许修改/etc/hosts文件或创建任何附加的hosts文件来存储主机名和ip地址 因此,在dnsmasq.conf文件中,我添加了主机名和ip地址 address=/node01.black.system/10.248.11.21 当我打字的时候 nslookup node01.black.system 我得到结果的ip地址。但它并没有使cersa堕落。 如果我这样做 我正在获取服务器找不到…:NXDOMAIN 但是,当我在dnsm

我的服务器中有dnsmasq设置。出于某些安全原因,我不允许修改/etc/hosts文件或创建任何附加的hosts文件来存储主机名和ip地址

因此,在dnsmasq.conf文件中,我添加了主机名和ip地址

address=/node01.black.system/10.248.11.21
当我打字的时候

nslookup node01.black.system
我得到结果的ip地址。但它并没有使cersa堕落。 如果我这样做

我正在获取服务器找不到…:NXDOMAIN

但是,当我在dnsmasq.conf文件中添加ptr记录时

ptr-record=21.11.248.10.in-addr.arpa., node01.black.system
然后如果我打字

nslookup 10.248.11.21
我正在得到结果主机名。是否有一种方法可以在不添加ptr记录的情况下实现这两种方式

因为大约有100个节点,在服务器中无论哪种方式都需要解析


谢谢

也许您正在寻找创建A和PTR记录的--host record指令

 --host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]
   Add A, AAAA and PTR records to the DNS...
 -A, --address=/<domain>/[domain/]<ipaddr>
   Specify  an  IP address to return for any host in the given domains. 
   Queries in the domains are never forwarded and always replied to with
   the specified IP address which may be IPv4 or IPv6.
而根据dnsmasq手册页,地址选项是为域中的任何地址定义返回的IP。它没有提到创建PTR记录

 --host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]
   Add A, AAAA and PTR records to the DNS...
 -A, --address=/<domain>/[domain/]<ipaddr>
   Specify  an  IP address to return for any host in the given domains. 
   Queries in the domains are never forwarded and always replied to with
   the specified IP address which may be IPv4 or IPv6.
-A,--address=/[domain/]
为给定域中的任何主机指定要返回的IP地址。
域中的查询永远不会转发,并且总是以
指定的IP地址,可以是IPv4或IPv6。
由于您无法修改/etc/hosts文件或创建任何其他主机,以下情况可能不适用于您的情况:;但我认为它们是有用的和相关的。这两个选项允许在普通/etc/hosts和dnsmasq配置之外定义主机

 -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.

 --hostsdir=<path>
   Read all the hosts files contained in the directory. New or changed files are 
   read automatically. See --dhcp-hostsdir for details.
-H,--addn主机=
其他主机文件。读取指定的文件以及/etc/hosts。
如果给定-h,则仅读取指定的文件。此选项可能会重复一次
多个附加主机文件。如果给定了目录,则
读取该目录中包含的所有文件。
--霍斯迪尔酒店=
读取目录中包含的所有主机文件。新的或更改的文件将被删除
自动阅读。有关详细信息,请参阅--dhcp hostsdir。