L
L
Lizard2021-05-26 17:47:02
linux
Lizard, 2021-05-26 17:47:02

Why doesn't DNSmasq resolve names?

I have a Linux server with dnsmasq on it. parameters:

[email protected]:/var/run/dnsmasq#cat /etc/dnsmasq.conf
listen-address=212.32.248.109
no-dhcp-interface=lo0
log-queries
[email protected]:/var/run/dnsmasq#

[email protected]:/var/run/dnsmasq# cat /etc/dnsmasq.hosts
212.32.248.109 vk.com.
212.32.248.109 vk.com

Status:
● 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.

And when I try to ask the server if it knows the domain of interest, it does not see the hosts file.
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

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Dmitriev, 2021-05-26
@rootovich1

Because dnsmasq.hosts is not included in the config file via addn-hosts

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question