View previous topic :: View next topic |
Author |
Message |
Negated Void l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 25 Dec 2002 Posts: 672
|
Posted: Wed Apr 16, 2003 4:15 am Post subject: Setting up a DNS server! |
|
|
I've got a router type server, and it basicly runs the show for my house's networking stuff.
I want to setup a DNS server on it, so the computers on the network will look there to resolve stuff, and it'll just query my ISP for the information.
I also would like to be able to map several hosts to specific IP's, much alike setting the hosts file, only it'd affect every computer on the network.
I'm fairly sure this shouldn't be that hard, what ebuild do you guys reccomend?
Thanks very much,
-Matt |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
s1th n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/52990176742fc508ebb3db.gif)
Joined: 30 Mar 2003 Posts: 31 Location: Almere, Netherlands
|
Posted: Wed Apr 16, 2003 1:39 pm Post subject: |
|
|
You can always start off with a BIND release (BIND 8 should suffice, you could also choose for BIND 9).
More info on BIND can be found at http://www.isc.org/products/BIND/
So, that's ebuild bind 9.2.2 (net-dns/bind).
Do not mistake this for net-dns/bind-tools since these are only the client tools for name resolving like dig, host and nslookup (nslookup = deprecated)
HTH _________________ Why did it happen ? BOFH Excuse:
Zombie processes haunting the computer |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mkremers n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Southpark/avatar19.gif)
Joined: 26 Oct 2002 Posts: 21
|
Posted: Wed Apr 16, 2003 5:32 pm Post subject: |
|
|
You can use dnsmasq for this, it will act as a dns server on your network but it will simply look into the /etc/hosts file of the machine it runs on (the router) or use the dns of your ISP (/etc/resolve.conf) in case /etc/hosts does not contain the requested entry. Very simple to setup:
Code: |
emerge dnsmasq
rc-update add dnsmasq default
|
If you also run a dhcp server for your network you should set the option domain-name-servers to the ip address of the router (/etc/dhcp/dhcpd.conf). If not you should specify your router as the dns on the client pc's (in /etc/resolve.conf). |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
WarMachine Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 15 Jul 2002 Posts: 181
|
Posted: Wed Apr 16, 2003 10:21 pm Post subject: |
|
|
dnsmasq works great for me, very easy to setup |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
adobo n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 14 Apr 2003 Posts: 3
|
Posted: Thu Apr 17, 2003 8:00 pm Post subject: |
|
|
can i use dnsmasq as the dns server for my domain names?
right now i am using zoneedit as my dns server.
i have lots of virtual domains under my main domain, so i jsut have to add each of the vitrual domains in my /etc/hosts file?
thanks! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
WarMachine Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 15 Jul 2002 Posts: 181
|
Posted: Thu Apr 17, 2003 10:51 pm Post subject: |
|
|
Although I haven't tried it I believe so |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cederberg Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/11312769463e3879dcd45e8.jpg)
Joined: 23 Jan 2003 Posts: 349 Location: Stockholm / Sweden
|
Posted: Fri Apr 18, 2003 9:31 am Post subject: |
|
|
adobo wrote: | can i use dnsmasq as the dns server for my domain names?
right now i am using zoneedit as my dns server.
i have lots of virtual domains under my main domain, so i jsut have to add each of the vitrual domains in my /etc/hosts file? |
It is possible to use for an internal network, but I wouldn't recommend it if you are providing external DNS. I know too little about DNS to reason about it, but the recommendation seems to be to use different servers for authoritative DNS and caching DNS.
A good authorative DNS server is djbdns. Dnsmasq is a caching DNS. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mekki20 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_r2-d2.gif)
Joined: 08 Apr 2003 Posts: 15 Location: Furtwangen
|
Posted: Thu May 01, 2003 8:45 am Post subject: dnsmasq not working correctly |
|
|
Hello,
I just installed the great dnsmasq. It's just great, if it would work.
I have it running on my firewall machine, also acting as gateway/route´r + dhcp-server
That's how have it setup:
- I have all hosts files on the clients left blank.
- /etc/hosts/ on FW is filled with all clientnames/ips of the clients with static ips in the network
- /etc/resolv.conf on FW is holding my two external nameservers.
- The clients DNS-Server is only the IP of the FW(192.168.0.1)
This is what I can do:
- ping any machin outside my network, e.g. www.gentoo.org
This is what I can NOT do:
- ping any machin within my network (192.168.0.0/24)
Is there a way to have more output to var/log/messages concerning dnsmasq?
Can anyone help?
M3i
Correction: I can ping some of my internal hosts. But I do NOT know why I can ping some of them and some not. And there are no hosts specified in the local /etc/hosts files of the clients.
Those hosts that are being translated to IPs are pingable from all other hosts, not just from one...I tested it.
M3i |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cederberg Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/11312769463e3879dcd45e8.jpg)
Joined: 23 Jan 2003 Posts: 349 Location: Stockholm / Sweden
|
Posted: Thu May 01, 2003 11:50 am Post subject: |
|
|
Weird. Sounds to me like the /etc/hosts file on your firewall is either incomplete and/or hasn't been properly loaded by dnsmasq. I assume that you can ping all hosts using their IP adresses, and that it is only the DNS lookup for some hosts that fail.
I'd try "/etc/init.d/dnsmasq restart" just to make sure all config files have been updated. Then you can always add "--log-queries" to the DNSMASQ_OPTS variable in the /etc/conf.d/dnsmasq file. See "man dnsmasq" for some other nifty options you can add in there. (I use "--bogus-priv" for my private lan, but that seems unrelated to your problems.) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mekki20 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_r2-d2.gif)
Joined: 08 Apr 2003 Posts: 15 Location: Furtwangen
|
Posted: Thu May 01, 2003 12:51 pm Post subject: |
|
|
Jipp, you are right. It is "just" a DNS-problem. I can ping the local machines, through their ip-address.
I also did a restart of 'dnsmasq' a several times. But no change.
I now have more output in /var/log/messages. But still can not figure out, why I am not getting it to work resolving my local hostnames.
I did another check and found out, that NONE of the local hostnames are not likely to be resolved. The ones I can ping are in the cache somewhere on the local machines. Damn Window$.
When I start dnsmasq with the options --no-daemon --log-querries
and do a SIGUSR1 on dnsmasq I get the listing of all cached IPs and Hostnames. There are all I want there, including the local ones from the FW's /etc/hosts file.
The only difference between the IPs from the lease-file from dhcpd and /etc/hosts are the letters in the FLAG-column of the output.
Code: | dnsmasq: Host Address Flags Expires
dnsmasq: host1 192.168.0.252 4FR D Fri May 2 11:14:21 2003
dnsmasq: host2 192.168.0.116 4FRI H |
So the first entry is taken out of the lease-file of the dhcpd and the 2nd entry is from /etc/hosts.
Again: I can ping 'host1', but NOT 'host2'
I don't know what to do.
Last edited by mekki20 on Thu May 01, 2003 1:25 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
cederberg Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/11312769463e3879dcd45e8.jpg)
Joined: 23 Jan 2003 Posts: 349 Location: Stockholm / Sweden
|
Posted: Thu May 01, 2003 1:22 pm Post subject: |
|
|
Hmm... I think I'd try a number of diagnostic checks:
1. Verify that the DNS server IP is set to your firewall on your (Windows) clients. Maybe you should try to configure it hard if you use DHCP.
2. Run some "host <mylocalhostname> 127.0.0.1" tests on the firewall.
3. Run "tail -f /var/log/messages" to make sure your DNS requests on the clients really pass through dnsmasq.
4. Make sure you reboot the Windows machines (only way I know to be certain their caches are empty).
If everything is as it sounds, only test 2 should fail. I guess then that you'd have to look into the /etc/hosts file for some weirdness or check the dnsmasq configuration. Starting it from the command-line is probably good for debugging. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
mekki20 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_r2-d2.gif)
Joined: 08 Apr 2003 Posts: 15 Location: Furtwangen
|
Posted: Fri May 02, 2003 9:59 am Post subject: it works (just for completness) |
|
|
Hi,
I just got it to work. Don't ask me, why it is working now.
I wrote Simon Kelly, the developer of dnsmasq and he wrote me back
That is what he wrote:
"The cache dump is normal - the I just means that the entry is imortal -
it will never time out. I'd start by doing testing with dig or nslookup
rather that ping - that way you can distiguish dns problems from routing
or host problems...."
![Idea :idea:](images/smiles/icon_idea.gif) |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|