dnsmasq

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

dnsmasq

Postby fede » Mon Nov 11, 2013 2:14 am

This is not a really new topic, but I can't search for my old posts, since the search engine says I can't make a search so soon after my previous one, even if there was no previous one... Oh, well.

Anyway, some time ago I asked for help in setting up my laptops to access my mail and file server at home from everywhere, including home, and Neil Bothwick was very nice in pointing me to his article in LXF 170 on setting up a local DNS using dnsmasq. In the article it also says that one should set up dnsmasq as the LAN's DHCP server so it knows where the various computers are, and consequently disable the router's DHCP service.

I dragged my feet for a long time, and finally today I tried to put this idea to work. Unfortunately, once I disabled my router's DHCP service, the server and all other wired machines lost the network and would not connect, even after having been given an IP manually (and, hopefully, having set up dnsmasq, resolv.conf and so on as directed). I could connect with a wireless interface, by setting an IP manually, though. So, now I am back at the original set-up, but I would like to set the dnsmasq set-up to work.

I am a total newbie in terms of networks (I can just do a manual basic ifconfig or iwconfig as my high point), so I suspect I am missing something really simple. The router is a D-Link DIR-601, if that's useful information. Thank you for any suggestion
fede
 
Posts: 56
Joined: Thu Sep 01, 2005 3:23 am

Postby Dutch_Master » Mon Nov 11, 2013 3:17 am

Sequence is the key: first shut all computers down cleanly to release their leases, disable the DHCP server in your router, then fire up dnsmasq. Reboot each machine, it should then query the network for a DHCP lease from whatever DHCP server is active, on the subnet specified in the DHCP server config file. My advise would be to do any config on unfamiliar tools via Webmin (provided it has an interface for it, most packages do) to circumvent syntax errors. It won't save you from erroneously entered data though ;) So you still need a basic grasp of how networks actually work. Your first call would therefore be to study that, there's a lot to be found online.
Dutch_Master
LXF regular
 
Posts: 2438
Joined: Tue Mar 27, 2007 1:49 am

Postby nelz » Mon Nov 11, 2013 9:33 am

dnsmasq doesn't need much configuration to do basic DHCP, this is what I have

Code: Select all
dhcp-range=192.168.1.128,192.168.1.192
dhcp-option=option:router,192.168.1.42


The first gives the range of DHCP addresses to use and the second tells dnsmasq the address of your router.

There should be a configuration option that is commented out
Code: Select all
conf-dir=/etc/dnsmasq.d

Uncomment this and put your settings in a file in this directory. It makes it much easier to understand than mixing it in with the general config file.

This is particularly clean when you start adding specific addresses for computers, as you can have a separate file for each one.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8468
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Thanks!

Postby fede » Mon Nov 11, 2013 11:29 pm

Those were fast replies! Thank you. I'll sit down and be more patient, following your advice :)
fede
 
Posts: 56
Joined: Thu Sep 01, 2005 3:23 am


Return to Help!

Who is online

Users browsing this forum: Google [Bot] and 1 guest