Joined: 06 Jun 2006 Posts: 7492 Location: Dresden, Germany
Posted: Sun Jul 02, 2006 4:28 Post subject:
look at the last line in your hosts file. this is invalid for dnsmasq. please just put one host behind a ip. these are manually edited hosts files. dd-wrt has a own way for creating it. so own modifications can not be supported by me or the developers. also if you type something inside it does not mean that dnsmasq will reload the hosts file or something else.
if you want hosts support, use the dhcp static lease table.
if you do something manually on the console you have to care about the following errors of your work _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Except I don't want to use static leases! I want to maintain a single hosts file on my router, and have the router perform DNS for my local network. Again, I'm not trying to be a pain in the ass, but it seems a pretty reasonable request. And is supposed to work out of the box with dmasq.
Quote:
please just put one host behind a ip. these are manually edited hosts files.
I have tried putting a single name behind the IP. That does not change the behaviour.
Quote:
dd-wrt has a own way for creating it. so own modifications can not be supported by me or the developers.
This I don't understand. /etc/hosts is a basic file that is standard across every *nix platform.
Joined: 06 Jun 2006 Posts: 7492 Location: Dresden, Germany
Posted: Sun Jul 02, 2006 15:56 Post subject:
sure. but you have to check your conditions and maybe to restart dnsmasq after editing it _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
(deleted portions .. you answered many questions above)
jstrauss, just curious, you seem to have a very interesting and unusual situation where you have a lot of machines like "ted" that don't seem to support DHCP.
Is this the case?
If its not too much to ask, can you shed light on what kind of network you are trying implement with DD-Wrt?
Thanks.
Its a very simple network in fact. The names I'm using are just test names while my router is plugged into my laptop (wired).
I have ISP->DSL Modem->DDwrt -> 3 linux servers with static IPs, 2 M$ clients with dynamic IPs
I use the periodic table for my machine names and IPs. So I wanted to preload my /etc/hosts with all of the periodic table, that way as I add servers, everything from a DNS perspective is already done.
I have 2 DD-WRTs, one running my network, and the other I'm testing with. From my M$ lapton, I'm connected wirelessly to my production router, and wired to my test one.
Joined: 06 Jun 2006 Posts: 7492 Location: Dresden, Germany
Posted: Sun Jul 02, 2006 16:56 Post subject:
you can edit what you want. dnsmasq will not consider it from scratch. you must give dnsmasq a signal to reload the hosts file. the easiest way is restarting it _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
2) when you reboot, dmasq startup seems to run BEFORE the startup script, so that additions to /etc/hosts from the startup script are not loaded into dmasq
Joined: 06 Jun 2006 Posts: 7492 Location: Dresden, Germany
Posted: Sun Jul 02, 2006 17:39 Post subject:
restarting dnsmasq as service will overwrite the hosts file. no you have todo it manually. a rc_startup script with a restart delay coud be possible. _________________ "So you tried to use the computer and it started smoking? Sounds like a Mac to me.." - Louis Rossmann https://www.youtube.com/watch?v=eL_5YDRWqGE&t=60s
Yup. I sugggest a delay to ensure avoiding a race condition with the start of dnsmasq, or perhaps a loop that waits until it sees dnsmasq in the ps output.
The delay is simple.
The following will wait for 10 seconds ...
sleep 10
Here is a starting point for a wait loop ...
while [ "`ps | grep dnsmasq | grep -v grep`" == "" ]
do
echo "Waiting for dnsmasq ..."
sleep 1
done
... which will write out the line "Waiting for dnsmasq ..." for as long as dnsmasq is NOT detected runnning, and exit once dnsmasq comes up.
If for some reason dnsmasq does not start ... then this loop will "hang" ... but with more programming, you can put in more error checking if you wish.