What does dnsmasq do?

Are there any important properties about a DHCP server I should keep or will the router work fine anyways?

I'll be honest, I've never had anyone want to remove a DHCP Server and only statically address their network (at least not in a non-secure setting). I don't know your use case, or why you desire to remove it.

To answer your direct question: It will continue work, minus all the functionality provided by dnsmasq (which is a lot) - obviously.

1 Like

Ok thank you

1 Like

The terms "DNS cache" or "querier" could be better used here i suppose, if semantics of the term was your concern.

I have one more question as if you don't mind to tell me what are to commands to "unconfigure" OpenDNS from my router, because this is the main thing I'm trying to do, if removing dnsmasq will be pretty important to keep.

I'll be happy to tell you, as soon as you explain how you managed to put them there. You'd simply undo that process you used to add them in the first place.

Perhaps, you should inform the users reading here - that you have another ONGOING thread on how to block OpenDNS IPs. It may give context to whatever you're referring to.

Well, my SSH skills suck, so I got someone to do it for me, but I have a copy of the commands so I'll try to do it.

Got it

1 Like

:open_mouth: Your other thread shows that you're controlling the web GUI???

(See, this was the "providing context" I was mentioning.)

So, why do you now note SSH is a setback then?

My bad on my part, I saw the person who was configuring the dnsmasq using SSH and I was checking other places to see how to "reconfigure it" it, and all I got were SSH commands, nothing to do with a web GUI.

OK...that seems random and not good. Seems you may have entered commands - not knowing what they actually do. Since we don't know the commands...can't tell you exactly where to locate them in the web GUI.

You could get download a backup of the config, and browse the files contained therein.

  • You will find DNS settings in /etc/config/network under the Interfaces
  • DHCP settings are under '/etc/config/dhcp'

Then on the web GUI:

Once you ID whatever OpenDNS setting (or whatever) bothers you, ask in the forum.

Or you can reset to defaults.

Alright, I'll give you an update once I get the commands for it.

I have just gotten the commands for the configuration of the DHCP servers (Sorry if I say some stuff that doesn't seem right), I believe this is what makes it reroute the DNS servers to OpenDNS, I may not be 100% correct, though.
First File

root@OpenWrt:/etc/config# cat dhcp

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option filterwin2k '0'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option nonegcache '0'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config dhcp 'GreenZone'
        option interface 'GreenZone'
        option start '50'
        option limit '10'
        option leasetime '1h'

config dhcp 'GreyZone'
        option interface 'GreyZone'
        option start '50'
        option limit '10'
        option leasetime '1h'

config dhcp 'BlueZone'
        option interface 'BlueZone'
        option start '50'
        option limit '10'
        option leasetime '1h'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

Second File

config dnsmasq
        option domainneeded '1'
        option boguspriv '1'
        option localise_queries '1'
        option rebind_protection '1'
        option rebind_localhost '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.auto'
        option localservice '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv6 'server'
        option ra 'server'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'

config dhcp 'GreenZone'
        option interface 'GreenZone'
        option start '50'
        option limit '10'
        option leasetime '1h'

config dhcp 'GreyZone'
        option interface 'GreyZone'
        option start '50'
        option limit '10'
        option leasetime '1h'

config dhcp 'BlueZone'
        option interface 'BlueZone'
        option start '50'
        option limit '10'
        option leasetime '1h'

config odhcpd 'odhcpd'
        option maindhcp '0'
        option leasefile '/tmp/hosts/odhcpd'
        option leasetrigger '/usr/sbin/odhcpd-update'

I would like to mention the next parts are static IP address configurations and I believe this would probably leak some important information, but this is the commands, I have some other files, but this is what I believe configured the dnsmasq, also thanks for the help you've given me so far!

You belief is incorrect - indicative given we see no OpenDNS IP.

Can you now cat the other file:

Also, if this is too confusing, again - you can reset to defaults and set up the router yourself.

:open_mouth: OK, this was done in OpenWrt...which means you couldn't disable dnsmasq anyways. When I said static addressing when removing/disabling dnsmasq, you have to manually address every device on your network. Otherwise, you essentially configured dnsmasq to hand out a statically-assigned-DHCP-address. Good thing we caught this!

I found the /etc/config/network file
Here is the commands for it

root@OpenWrt:/etc/config# cat network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd61:24e1:b9d9::/48'

config interface 'GreenZone'
        option proto 'static'
        option ipaddr '10.0.0.1'
        option netmask '255.255.255.0'
        option dns '208.67.222.222'
        option type 'bridge'

config interface 'GreyZone'
        option proto 'static'
        option ipaddr '10.10.0.1'
        option netmask '255.255.255.0'
        option dns '208.67.222.222'
        option type 'bridge'

config interface 'BlueZone'
        option proto 'static'
        option ipaddr '10.20.0.1'
        option netmask '255.255.255.0'
        option dns '208.67.222.222'
        option type 'bridge'

config interface 'lan'
        option ifname 'eth1'
        option force_link '1'
        option type 'bridge'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option dns '8.8.8.8'

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'

config interface 'wan6'
        option ifname 'eth0'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '0 2 3 4 5'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '1 6'

root@OpenWrt:/etc/config#

I saw the OpenDNS DNS server, so I believe this is the one that's the one that configured it.

1 Like
  • You should only need to address DNS servers in WAN.
  • Your LAN will use Google
  • You setup something very convoluted here.
  • Removing ALL option dns statements should leave your router and clients using the ISP-assigned DNS servers (as long as you didn't change them in any static assignments)
  • On the web GUI, they are found under each Interface at:

Screenshot from 2020-04-23 11-12-45

or:

screen50

Alright, I'll try through LuCI, if the Web GUI doesn't work I will ask for the SSH commands

:confused:

Ummmmmmm...you just edit the files you showed us.

:bulb: You could even edit the files in the backup TAR file and re-upload the config...if commands are such a bother. :wink:

Ohh, that'll be way easier. So do I just delete the option dns commands?

Again, to reiterate:

Just remove those lines. Problem solved.

Also vi is the installed command line editor:

  • vi /etc/config/network
  • Go down to the option dns line
    • To delete-line, type :d and press Enter
  • Repeat for each line
  • To save/quit, :wq and press Enter
  • /etc/init.d/network reload
1 Like

Ok got it that

1 Like