Apologies if this turns out to be trivial, but getting dnsmasq to work has completely frustrated and defeated me, after days of faffing around.
I have a bunch of vhosts on a server, and need to access them from other devices. To date, I’ve done this via /etc/hosts on each device. However, an iPad, iPhone and Samsung tablet now also need access, hence looking at dnsmasq.
Fedora 35, installed Nov.2021
dnsmasq v 2.86
127.0.0.1 localhost localhost.localdomain
::1 localhost localhost.localdomain
… … …
Router: Fritzbox 7490
Local DNS Server: 192.168.178.9 (server)
NM config for wlp5s0 (wifi conn on server)
Gateway: 192.168.178.1 (router)
DNS Servers: 127.0.0.1 (server)
Search domains: localhost
Most of the help on the web uses dnsmasq as both a DNS server and DHCP lessor. I /only/ want to run the DNS server, leaving the router to assign leases as it sees fit.
I couldn’t figure out how to stop NM from running the dnsmasq plugin which was blocking port 53, and ended up killing the process. In case the plugin starts up on next reboot, it would be good to know if there is a better way.
resolv.conf -> /run/systemd/resolve/stub-resolv.conf
options edns0 trust-ad
$ netstat -tulpn | grep ":53 "
tcp/udp 0 0 192.168.178.9:53 0.0.0.0:* LISTEN 2250435/dnsmasq tcp/udp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 2250435/dnsmasq tcp/udp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 2213842/systemd-resolve
Output from dig on the server:
; <<>> DiG 9.16.28-RH <<>> vhost1.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57328
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;vhost1.lan. IN A
;; ANSWER SECTION:
vhost1.lan. 0 IN A 127.0.0.1
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Sun May 22 07:10:27 CEST 2022
;; MSG SIZE rcvd: 55