LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-11-2005, 07:43 AM   #1
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Rep: Reputation: 15
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

Last edited by turnbui; 08-11-2005 at 07:45 AM.
 
Old 08-12-2005, 03:18 AM   #2
calabash
Member
 
Registered: Sep 2003
Distribution: FC11
Posts: 128

Rep: Reputation: 15
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.
 
Old 08-13-2005, 02:09 PM   #3
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
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.
 
Old 08-13-2005, 05:44 PM   #4
aznluvsmc
Member
 
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184

Rep: Reputation: 30
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.
 
Old 08-13-2005, 06:58 PM   #5
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
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,
 
Old 08-13-2005, 11:24 PM   #6
aznluvsmc
Member
 
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184

Rep: Reputation: 30
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.
 
Old 08-14-2005, 06:41 AM   #7
turnbui
Member
 
Registered: Jul 2005
Location: UK
Posts: 101

Original Poster
Rep: Reputation: 15
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
 
Old 08-14-2005, 07:20 PM   #8
aznluvsmc
Member
 
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184

Rep: Reputation: 30
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.
 
Old 08-14-2005, 07:22 PM   #9
aznluvsmc
Member
 
Registered: Aug 2004
Location: Newmarket, Ontario
Distribution: OpenSuse 10.2
Posts: 184

Rep: Reputation: 30
This may be useful for you:

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SUSE DNS & Active Directory suseguy Linux - General 0 11-15-2005 02:46 AM
Sues 9.1 Pro DHCP Server in Active Directory Maximus2000 Linux - Networking 1 07-21-2005 12:09 PM
forward dns from dhcp to dhcp Fark Linux - Networking 3 03-31-2004 10:40 AM
rh9 dns and w2k3 active directory ewlnxnewB Linux - Networking 2 11-15-2003 02:10 AM
unable get dhcp with iptable firewall active LionKing Linux - Networking 4 02-19-2002 06:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration