Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.