PDA

Bekijk de volledige versie : dnsmasq acting as DNS server?



frank_c_bauer
24-03-2005, 16:53
Hi, I'm using wl500g with Oleg's 1.9.2.7-cr3 firmware. I'd like it to behave like a small DNS server for my network. Clients getting IP address through DHCP are registered ok and I can pping them by name, but I can't figure out what should I make to dnsmasq to recognize static ip addresses and also respond to MX requests.
According to the dnsmasq help it should be sufficient to

echo "192.168.1.2 server.my.net server" >> /tmp/etc/hosts

but this doesn't seem to work. ("my.net" is set in the web interface as my domain.) I suppose I have to save this somehow to the flash memory? And I'm totally clueless about the MX record (should be pointing to server.my.net).

Thanks for any hints.

tomilius
25-03-2005, 04:06
Good sir!

I believe this is all you really needed to know:
/usr/local/etc/hosts is where you should put your custom entries
I use domain-suffix in dnsmasq.conf (/usr/local/etc/dnsmasq.conf should do it) but that's probably what "domain" as you mentioned does anyway

Now, if you statically-assign your IP address then the machine is not getting the connection-specific DNS suffix from the DHCP server like it usually would. So, set it manually as well to my.net.

In Windows, simply go to the advanced TCP/IP properties for your connection and access the DNS tab. Under "DNS suffix for this connection" enter in my.net, and that should do it.

frank_c_bauer
25-03-2005, 11:47
Ah, I was probably a a bit unclear.

My problem is not that server.my.net can't resolve names due to missing dns suffic my.net. The problem is that I can't convince dnsmasq in wl500g to resolve names of hosts in my local network which have static IP addresses. (Those with DHCP assigned address are ok, because it was dnsmasq who assigned them).

I tried to add the pairs (well, triples) of IPaddress FQDN hostname to the /tmp/etc/hosts but dnsmasq seems to ignore these. I suppose I need to save this file to flash rom and restart the router, but this is the point where I need some help.

tomilius
25-03-2005, 12:21
A lot of complex terminology there (FQDN, MX record), but maybe it's still so simple, because I have never heard those before.

Put your custom entries in /usr/local/etc/hosts. They will be appended to /etc/hosts at router's boot (/tmp/etc is /etc).

Run the following:

flashfs enable
flashfs save
flashfs commit

The enable only needs to be done once per firmware upgrade.
Reboot.
Alternatively, see if your modifications to /etc/hosts work first by modifying it and running:
killall dnsmasq
dnsmasq

I think that may be what you want.

IMPORTANT: When not testing dnsmasq and /etc/hosts in the way described, put your CUSTOM entries in the persistent portion /usr/local/etc/hosts and save and commit flash.

ghaspias
21-08-2005, 19:30
How about setting up an authoritative dns server? is dnsmasq capable of serving a domain name I registered? I have tried maradns, which seems to work, but I then lost the dhcp functionality... or can I have maradns serve as dhcp also?
For now, I am running maradns as my dns server in a linux machine in my lan, set up port forwarding (virtual server) in the wl500g, and it is working fine, but I wanted to put it in the router.

ghaspias
03-11-2005, 00:37
anybody...