dnsmasq broke - doesn't server up DNS for local network

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2
Author Message
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Jul 02, 2006 4:28    Post subject: Reply with quote
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
Sponsor
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 14:52    Post subject: Reply with quote
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.

-jay
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Jul 02, 2006 15:56    Post subject: Reply with quote
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
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 16:12    Post subject: Reply with quote
Hi,

I just played with static leases. They work. But here are the problems:

1) you need a MAC address for them to save. So if you do NOT want to attach IPs to MACs then you need to use a fake MAC

2) if you have a lot of hosts, then it takes a looooong time to enter those into the static leases page

Thanks
Jay
pagedude
DD-WRT User


Joined: 14 Jun 2006
Posts: 59

PostPosted: Sun Jul 02, 2006 16:14    Post subject: Reply with quote
(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.
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 16:49    Post subject: Reply with quote
Surely :)

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.

make sense?

Jay
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 16:51    Post subject: Reply with quote
BrainSlayer wrote:
sure. but you have to check your conditions and maybe to restart dnsmasq after editing it


BrainSlayer, I don't really understand what you're talking about? Check what conditions?

Thanks
Jay
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Jul 02, 2006 16:56    Post subject: Reply with quote
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
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 17:36    Post subject: Reply with quote
1) can you restart dmasq from web admin?

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

thanks
Jay
BrainSlayer
Site Admin


Joined: 06 Jun 2006
Posts: 7492
Location: Dresden, Germany

PostPosted: Sun Jul 02, 2006 17:39    Post subject: Reply with quote
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
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 18:26    Post subject: Reply with quote
Is there any problem doing:

<inside the startup_rc file>

echo '192.168.1.39 yttrium yb' >> /etc/hosts
echo '192.168.1.30 zinc zn' >> /etc/hosts
echo '192.168.1.40 zirconium zr' >> /etc/hosts

killall dnsmasq
dnsmasq --conf-file /tmp/dnsmasq.conf

It works fine in my tests
Jay
pagedude
DD-WRT User


Joined: 14 Jun 2006
Posts: 59

PostPosted: Sun Jul 02, 2006 21:03    Post subject: Reply with quote
jstrauss wrote:

<snip>
make sense?


yup. I take it back, not unusual at all.

jstrauss wrote:

<snip>
killall dnsmasq
dnsmasq --conf-file /tmp/dnsmasq.conf

It works fine in my tests
Jay


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.
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Sun Jul 02, 2006 21:41    Post subject: Reply with quote
Can you post an example of each?

thanks
Jay
pagedude
DD-WRT User


Joined: 14 Jun 2006
Posts: 59

PostPosted: Sun Jul 02, 2006 22:37    Post subject: Reply with quote
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.



jstrauss wrote:
Can you post an example of each?

thanks
Jay
jstrauss
DD-WRT Novice


Joined: 17 Jun 2006
Posts: 41

PostPosted: Mon Jul 03, 2006 3:58    Post subject: Reply with quote
Oh, thanks. For some reason I was thinking you meant something more dd-wrt-ish :)

Jay
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum