LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   DNS - how does this work if DHCP active (https://www.linuxquestions.org/questions/linux-networking-3/dns-how-does-this-work-if-dhcp-active-352171/)

turnbui 08-11-2005 07:43 AM

DNS - how does this work if DHCP active
 
Please would someone explain how I can set up DNS if I have DHCP.
I have 1 port off a D-Link D504T router which goes to my Linux Mandrake 10.1 box.
The router is set to DHCP and my eth1. This is on subnet 192.168.1.0/24. Eth0 is on subnet 192.168.3.0/24 eth0 = 192.168.3.1 and the Win-XP prof machine is x-over'd to eth0 is 192.168.3.2. The Linux box runs Samba and is a WINS server.
The other 3 ports off the router go to Win-XP Home machines. They are named Nick, Tony & Howell and are all on subnet 192.168.1.0/24
My linux box 192.168.1.n is "turnbui" but the 192.168.3.1 is Samba set up as WINS.

All is well until the DHCP lease expires and the machines are powered up in a different order thus getting different IP's. Linux doesn't appear to handle this well, in fact the original DHCP lease was set to 1 hour and on expiry I had to physically reset it using Mandrake control centre until I put some stuff in rc.local to reset on every boot.

Perhaps the problem is with Linux not interfacing with said router? Or is this a common problem? Indeed is this where DNS is set up from??

I don't really want to give each machine a static IP or change the lease time in DHCP. BUT if I am compelled to use the hosts/lmhosts file [which calls for a static IP or some boot-time job to rebuild hosts/lmhosts] in order to have DNS working then I guess I'll hve to,

Am I confusing DNS and WINS - hosts/lmhosts file?

Please tell me different and that with DHCP I can set up local DNS.

Any help to educate me would be much appreciated.

Thanks

calabash 08-12-2005 03:18 AM

Any chance of isolating this by unplugging the x-over'd XP box and plugging the SAMBA/WINS port into the router and IP'ing it on the same subnet?

Then we could be sure that the physical network is the issue.

turnbui 08-13-2005 02:09 PM

it is connected to the router
 
The Linux box is connected to the router.
Rather verbose was my explanation.
Everything does work, just that I'm not sure of how I managed it.
What I really want to know is:-

How does DNS get "populated". Is it a file like HOSTS?
If the router is DHCP should DNS work when a different machine gets a different IP on lease-up?

Thanks for replying.

aznluvsmc 08-13-2005 05:44 PM

From my understanding eth1 on the Linux machine uses DHCP whereas all the computers on the 192.168.3.0/24 network have static IPs. I don't understand what the problem is when Eth1 gets a new IP.

turnbui 08-13-2005 06:58 PM

problem was I couldn't ping by name
 
I couldn't ping by name "tony", "nick" etc, This was when their computers, also on router got different IP's.
We power them down usually.
In the end I had to STOP the DHCP and force router to reserve IP for a particular machine. Sort of defeats the object in my opinion.
Just why this happened I'm delving into,
Bur as I don't know HOW DNS works I'm pushing it uphill.

Basically I'd like to know how DNS actually works. How does the namespace get populated at boot time or when a new machine joins the network that is using DHCP. If "populated" is the right word.

I think I understand the use of HOSTS / LMHOSTS but these seem to be for small networks that are using static IP's. Yes, I do have a small network but thats not really the point. Knowledge is really the point and although I've googled quite a bit everything seems to think the reader is familiar with DNS.

Cheers,

aznluvsmc 08-13-2005 11:24 PM

The XP computers are on the 192.168.1.0/24 subnet but the SAMBA/WINS server is listening on the 192.168.3.0/24 subnet. What you can try (and I haven't tested it) is to set up the XP computers to register with the 192.168.3.1 WINS server by enabling IP forwarding on the Linux machines.

To enable IP forwarding type as root:

echo 1 > /proc/sys/net/ipv4/ip_forward

Now this is all assuming that SAMBA has been properly configured to work as a WINS server.

turnbui 08-14-2005 06:41 AM

Yes, I have MASQUERADE on and all OK
 
I have done
> cat /proc/sys/net/ipv4/ip_forward and got "1" returned thus ip_forward is on I take it.
Also I have MASQUERADE on and a route -p on the other Win-XP's on 192.168.1.0/24 subnet.
This info courtesy of Chris Street @ iwpcs.com.

All is working fine BUT I had to STOP DHCP on the router and set STATIC IP's up.

Thanks for your suggestions BUT I'm really interested in how DNS works. My DHCPD service is not running/
Is this my problem when the DHCP lease expires. Should Linux be able to query the router for any DNS info?
Perhaps this is the problem?

Can you tell me HOW DNS works?

Cheers

aznluvsmc 08-14-2005 07:20 PM

First of all there have been entire books written on DNS and probably in your case BIND (the Linux DNS server). To say how DNS works requires a book. Secondly, WINS and DNS are not the same thing so you may be confusing the two here.

aznluvsmc 08-14-2005 07:22 PM

This may be useful for you:

http://www.stamey.nu/DNS/DNSHowItWorks.asp


All times are GMT -5. The time now is 03:34 AM.