perhaps dumb question about double dns servers

Discuss Networking
Post Reply
Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

perhaps dumb question about double dns servers

Post by Ice9 » Tue Nov 21, 2006 2:44 pm

I would like to implement some stuff like a kind of intranet and shared calendars on my home network but that would require a dns.
Now I have a D-Link router which points to my provider's dns.

My question is:
Can I run a dns locally just to be able to access the workstations by other means than their dynamic IP, without interfering with the dns entries from my router?

I have 4 workstations and a file-server behind a D-link gaming router, and every time I need access to a box I have to run nmap first to know the IP.
Kinda annoying in the end.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Nov 21, 2006 3:19 pm

Are you saying that your DLink router does not provide local DNS for your local network? That would be pretty sad. Could it be that you just don't have your clients configured to update their hostname? There should be a box for it in your DHCP client settings. Put the hostname in there that you want to be entered in DNS. Have you defined your DNS name in the router or doesn't it give you that option? If your router doesn't provide DNS services for your local network then I would get different router (Linksys WRT54G/GS would be a good choice, but only if you get the Linux version). What model is your router so I can look up the manual? Maybe your D-Link is capable of running OpenWRT?

See http://www.openwrt.org/

OpenWRT works great for me (I have several LinkSys WRT54G and GSs):
http://voidmain.is-a-geek.net:81/

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Nov 21, 2006 4:02 pm

This is the router I own, but I don't think it can provide local dns ....
That is , if I understand what you say correctly :)

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Nov 21, 2006 4:30 pm

Looks like what you say is true and it doesn't look to be supported by OpenWRT. If it were me I would sell the thing and get WRT device. You can do what you asked though, that is to set up a separate DHCP/DNS server but that's what that little router should be doing for you. If you were to set up a separate DHCP/DNS server then I would suggest getting a WRT device and using it anyway (set it up behind your D-Link). You would turn off the DHCP server on your D-Link and turn it on in the WRT. Of course if you are going to do that you might as well just use the WRT and ditch the D-Link. So there you have it. :)

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Tue Nov 21, 2006 4:36 pm

If you look at page 18 of the manual they talk about adding static dhcp clients.
Isn't that something I could use?
As I see it I can select all the IP addresses of the lan and also enter the corresponding hostname, and if I understand that bit correctly the dhcp server remains active but these "static dhcp settings" will not be overruled, right?
So if another client logs on to my network it can still obtain an ip address automatically via the still running dhcp server ...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Nov 21, 2006 6:09 pm

The only thing the "static DHCP" addresses buy you is a guarantee that a specific machine will get a specific IP address. You still will not be able to resolve the addresses by name (or by reverse) unless you put the addresses in the /etc/hosts file on each machine you have, which may be good enough for you. Even if you don't use static DHCP leases each machine should still get the same address each time they boot as long as they are booted within the lease expiry period.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Wed Nov 22, 2006 3:36 am

Void Main wrote:
You still will not be able to resolve the addresses by name (or by reverse) unless you put the addresses in the /etc/hosts file on each machine you have, which may be good enough for you.
I thought about that but I wasn't really sure if it would work.
Adapting the /etc/hosts file on each machine would allow me to access each box via the hostname, providing that the IP address doesn't change, right?
And that would be the only file I would have to modify?
The IP address and the hostname woul be enough or do I have to have a full domain name for every host?
And if I have to have a full domain name, can I make up whatever I want or do I have to follow strict rules for it to work?

This would certainly work for me, at least as long as I can't dedicate a separate box for proxy/firewall/router.
And since I only have 5 boxes to maintain it wouldn't even be too much of a hassle.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Wed Nov 22, 2006 8:39 am

You don't need full domain. The resolver on each of your clients should look in your /etc/hosts file before going to DNS. I usually have a made-up domain for my internal machines anyway. For instance if I set up hosts files instead of DNS for my machines they would look something like this:

127.0.0.1 localhost.localdomain localhost
192.168.1.1 gateway.voidmain.home gateway
192.168.1.2 proxy.voidmain.home proxy
192.168.1.100 voidlinux.voidmain.home voidlinux
192.168.1.101 kidslinux.voidmain.home kidslinux
192.168.1.102 laplinux.voidmain.home laplinux

I would just place a copy of that file on every machine in the house and then would be able to resolve either the FQDN or just hostname of each machine. Basically just put anything in there that you want to resolve that isn't in DNS. If you have any Windows garbage you can put a copy on them too. If I recall way back in my memory banks from years ago I think the hosts file for them reside in \WINDOWS\system32\drivers\etc. I don't know where it goes on a Mac but it should be the same format.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Wed Nov 22, 2006 10:04 am

Void Main wrote:
If you have any Windows garbage you can put a copy on them too. If I recall way back in my memory banks from years ago I think the hosts file for them reside in \WINDOWS\system32\drivers\etc. I don't know where it goes on a Mac but it should be the same format.
No thanks :wink:
Actually there is one copy of Winblows, on the pc of my eldest son.
Purely for gaming purposes and I disabled the NIC so he has no chance of getting online or contaminating whatever is on my network if he gets infected by M$-sponsored bacteria!

But back on topic, you do have top make up kind of a fake domain for it to work?!

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Wed Nov 22, 2006 3:20 pm

Allright, got it working.
But I noticed in your sample hosts file you have an entry for your gateway, is that necessary?
I didn't include it in my hosts file and it still works ...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Thu Nov 23, 2006 10:33 am

No the gateway is not necessary unless you want to be able to access it via some name. You can make up any names you want, they don't have to match the actual name of the device, and no you don't have to create a domain. I do have a domain because I use DNS for my local network and not hosts.

Ice9
guru
guru
Posts: 577
Joined: Thu Jan 09, 2003 12:40 am
Location: Belgium
Contact:

Post by Ice9 » Thu Nov 23, 2006 2:00 pm

Ok, thank you :D
This just opened a whole lot of new possibilities ...

Post Reply