У меня есть сервер Линукс, на нем dnsmasq со след. параметрами:
root@ssd412:/var/run/dnsmasq#cat /etc/dnsmasq.conf
listen-address=212.32.248.109
no-dhcp-interface=lo0
log-queries
root@ssd412:/var/run/dnsmasq#
root@ssd412:/var/run/dnsmasq# cat /etc/dnsmasq.hosts
212.32.248.109 vk.com.
212.32.248.109 vk.com
Статус:
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: active (running) since Wed 2021-05-26 14:37:13 UTC; 4s ago
Process: 12964 ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf (code=exited, status=0/SUCCESS)
Process: 10776 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
Process: 13005 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
Process: 12997 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
Process: 12996 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
Main PID: 13004 (dnsmasq)
CGroup: /system.slice/dnsmasq.service
└─13004 /usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -r /var/run/dnsmasq/resolv.conf -7 /etc/
May 26 14:37:12 ssd412 dnsmasq[12996]: dnsmasq: syntax check OK.
May 26 14:37:13 ssd412 dnsmasq[13004]: started, version 2.75 cachesize 150
May 26 14:37:13 ssd412 dnsmasq[13004]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP connt
May 26 14:37:13 ssd412 dnsmasq[13004]: no servers found in /var/run/dnsmasq/resolv.conf, will retry
May 26 14:37:13 ssd412 dnsmasq[13004]: read /etc/hosts - 4 addresses
May 26 14:37:13 ssd412 dnsmasq[13004]: reading /var/run/dnsmasq/resolv.conf
May 26 14:37:13 ssd412 dnsmasq[13004]: using nameserver 8.8.8.8#53
May 26 14:37:13 ssd412 dnsmasq[13004]: using nameserver 8.8.4.4#53
May 26 14:37:13 ssd412 dnsmasq[13005]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link t
May 26 14:37:13 ssd412 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
И когда я пытаюсь спросить у сервера, знает ли он интересующий домен, он не видит файл hosts.
C:\Windows\system32>nslookup vk.com 212.32.248.109
╤хЁтхЁ: UnKnown
Address: 212.32.248.109
Не заслуживающий доверия ответ:
╚ь : vk.com
Addresses: 87.240.190.67
87.240.190.72
87.240.190.78
93.186.225.208
87.240.139.194
87.240.137.158