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.
My apologies in advance for a question that must have been answered before, but I sure can't find the answer.
I have a very simple local net with two PCs that, given a fqhn, can communicate with anything on the internet, but the only way they can talk to each other is if I specify their dynamically assigned IP addresses.
Network architecture:
fantom and moth are PCs running RHL 7.3
They connect to two lan ports on a ZyXEL B-2000 router/firewall.
The B-2000's wan port is connected to a DSL modem (Efficient Networks Speedstream 5100, if that matters).
The ISP assigns the domain name via DHCP, and the router assigns IP addresses to fantom and moth.
So, for example, on fantom
ping moth
fails, but
ping 192.168.1.33 (IP address assigned to moth by the B-2000)
succeeds.
It is slowly dawning on me that I may need to assign static IP addresses to fantom and moth, and edit their hosts files accordingly. If this a belated realization of the obvious, fine (recognition of one's ignorance is the first step toward wisdom).
But also not so fine. What's the benefit of letting the router assign the PCs' IP addresses, if, in order to get them to talk to each other, the user has to know the actual numeric addresses? It also raises the question of what to do when I want to use moth (a laptop) in another room and connect via wireless card, because then I'll have no control over its IP address--the B-2000 (which, in additon to 4 lan ports, does 802.11b)
will assign it one--or am I wrong again?
What you are attempting to do is a DHCP and DNS combination. So that you can ping moth, and have the DNS request answered by information created by the DHCP server, which in this case is a router. The good news is this Is possible, the bad news is, not likely in your current setup becasue of the nature of most consumer routers (I haven't looked into your specifically however). Even running an external DNS server wouldnt work becasue of the need to configure special options on the DHCP server. BTW this functionality as a whole is called Dynamic DNS.
IF HOWEVER, you wanted to remove the consumer router/firewall and replace it with a linux box, performing the same routing functions, then this would be a possibility. It would give you the freedom of control over both your DHCP and DNS server. But that is a significantly greater amount of work.
What you need is a DNS server. Check that your router does have one.
If you configure your router to assign dynamically addresses to clients in your internal network there should be a DNS server option too in the router.
If it does not have then you should not use its dynamic DHCP feature, should configure static IPs and edit hosts file.
It is not a unix bug, it is a router configuration issue.
I suggest you check your router's manual carefully and read DHCP and if exists DNS sections. Come back after then and will talk through if someting is missing.
It might also be interesting to see the contents of resolv.conf and please also post the configuration files for your eth0 (or whichever one is used on your network).
I'm following this question as it is similar to an issue that I want to resolve (pun).
Regarding the nameserver entry, at least in my setup, it's pointing to the nameservers that the isp assigns. Not that this will be a bother for internal addresses. I'm not familiar with your router. Does it act as a DNS server?
I think there may be two things to look at.
First, resolv.conf (I believe) wants the entry "search". This is germane, i believe, if you have a host controller on your local network. Do you?
Second, if you just want to resolve local machines, i think you can make entries in /etc/hosts.
The format is
ipaddress hostname alias
so for your machines it might be:
192.168.1.33 moth moth
I would strongly recommend using static ip's inside your local network. My wireless configuration allows me to set the laptop (on the wireless) to a static address, too.
Ah, well, in the end the answer was simple: the router does not act as a DNS server. It does know the names and IP addresses of the local machines, but it's still not a DNS server. Manually adding the local PCs to /etc/hosts fixed the problem. Thanks to all for your suggestions.
Strange, look at this link, then go to "datasheet" tis a PDF. It says all the features, and Dynamic DNS IS listed, maybe if you were to set up your own DNS it would do the updates, as you would require?
DynamicDNS support won't do anything for this issue but it's great to see this in the new products coming out.
Setting up an internal dns server is way overkill, but educational. NeuroMan would likely earn part of his Linux degree in that class I think the right thing was to setup the hosts file and fix the nameservers entry. Good show!
Ah, well, in the end the answer was simple: the router does not act as a DNS server. It does know the names and IP addresses of the local machines, but it's still not a DNS server. Manually adding the local PCs to /etc/hosts fixed the problem. Thanks to all for your suggestions.
I have the same problem. You said you Manually adding the local PCs to /etc/hosts fixed the problem. How do you give the local PCs the IP address since if you use router's DHCP to assign the IP address to your computers, you don't know what the IP address the DHCP assign to you pc.
Pls let me know what your /etc/hosts file looks like.
Thank you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.