I have configured dnsmasq as DHCP and DNS Server.
Now I would like to use dnsmasq as DNS SERVER ONLY.
The dhcp server functionality is done somewhere else and is not in the scope of my question.
When I try to remove the dhcp server functionality, I could not access to internet.
nslookup command to www.google.fr return no server found.
here dnsmasq for DHCP and DNS SERVER
# Configuration file for dnsmasq as DHCP and DNS server.
#
strict-order
bogus-priv
domain-needed
no-hosts
#
dhcp-option=option:router,192.168.130.230
#
# The conf-file option is also allowed in configuration files,
# to include multiple configuration files
#conf-file=
#
interface=srv_eth0
listen-address=192.168.130.123
#
domain=my-dom-test.nwk,192.168.123.0/24
#
# PUBLIC DNS
#
server=8.8.8.8
server=8.8.4.4
#
expand-hosts
#
dhcp-leasefile=/var/lib/misc/dnsmasq.leases
dhcp-lease-max=50
#
dhcp-range=192.168.130.165,192.168.130.199,16h
#
#
dhcp-host=00:1b:a9:3c:be:76,192.168.130.103,BROTHER-HL2150N
dhcp-host=00:15:99:8a:a0:19,192.168.130.104,SAMSUNG-CLP325W
dhcp-host=00:15:99:8a:a0:19,192.168.130.105,SONY-TV-BRAVIA-32EX500
#
# THE SERVER
dhcp-host=00:24:1d:c1:99:ba,192.168.130.123,LINUX-TEST-DNSMASQ
#
dhcp-no-override
# LOGS
#log-queries
#log-dhcp
Here resolv.conf
nameserver 127.0.0.1
here dnsmasq for DNS SERVER ONLY
#
# Configuration file for dnsmasq.
#
port=10053
domain-needed
bogus-priv
no-resolv
#
# SET MY DNS SERVER
#
server=8.8.8.8
server=8.8.4.4
listen-address=127.0.0.1
no-dhcp-interface=srv_eth0
domain=my-dom-test.nwk
#log-queries
#log-dhcp
here resolv.conf
search lan
nameserver 192.168.2.200
my ISP MODEM-ROUTER : 192.168.2.200
my NETGEAR DHCP/DNS server ( and gateway ) : 192.168.130.230
my linux server acting as a DNS relay server : 192.168.130.123 ( for my next mail server installation )
To me, your post is unclear what is running on which machine.
ie.
Is your DNSMASQ running on your client machine or on a “server” servicing your entire network?
And especially if it’s servicing the network and not just the local machine, is there some reason why you’d configure DNSMASQ <and> a separate DNS forwarder(if that is what you’re describing)? Although possible, that would be somewhat unusual (some kind of split-brain DNS). BTW - I assume you do mean a “DNS Forwarder” (The DNS roles are “authoritative,” “forwarder” and “caching”) which is the correct terminology, not to be confused with a “DHCP relay” which is another special server role.
When you did your nslookup test, you need to identify the server your resolver is pointing to, and then perhaps specify a different DNS server to narrow down whether the problem is client-side or server-side.
copy /usr/lib/systemd/system/dnsmasq.service
to
/etc/systemd/system/dnsmasq.service
In “/etc/dnsmasq.conf” If you use additional configuration files by the way of options (for example
resolv-file=/etc/resolv.dnsmasq.conf
or conf-file=/etc/dnsmasq.more.conf
or conf-dir=/etc/dnsmasq.d
…)
You must open Apparmor configuration using Yast.
Then Edit the profile ‘/usr/sbin/dnsmasq’ and then each files or directories must be set to r/w/x in accordance with the actions envisaged for dnsmasq.
Otherwise you will get a message like :“Dnsmasq unable to read files …” and then dnsmasq may failed to start.
for OS 13.2
In /etc/systemd/system/dnsmasq.service comment out the line as this :