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.
Short version:
I can't ping my windows machines, or the Linux machine by hostname, but I can by (dynamically assigned) IP. I've forgotten what I need to do to get Linux to find the hostnames of the other machines on the LAN.
Long version:
I have a LAN with a Linux (Mandrake 9.0) fileserver and Windows workstations (Win98SE and Wn2K). I go through a D-Link DI-704 Gateway/Router to get to a cable modem to get to the Internet. Everything was alive and well.
Had a power outage that exceeded my UPS's capabilities, machines went down hard and Linux "broke". Eventually re-installed Mandrake 9.0 with formatting native Linux partition (root) but not EXT3 partition (/home). My data's fine, but my "setups" are lost.
The IP addresses are assigned dynamically, presumably by the D-Link (whose address is 192.168.0.1) I've configured the Linux to use that address as a gateway.
The linux box can ping the Internet (like yahoo) and can ping the windows boxes on the LAN by IP. Pings to thier hostnames, or even the linux box hostname, fail: "Hostname not found", as I recall. I've tried hostname and hostname.workgroup, as:
ping fs
ping fs.myworkgroup.com
I've no addresses/hosts in /etc/hosts. I understand that that's for static IP addresses.
I note that in /etc/resolve.conf (as I recall) there are three entries:
nameserver #.#.#.#1
nameserver #.#.#.#2
search myworkgroup.com
The nameserver ip addresses are, I believe, the same as the one's I'd used for a DNS when setting up my cable modem.
I tried adding:
nameserver 192.168.0.1
to resolve.conf, but it seems to get overwritten during shut-down/reboot.
I tried adding via the Mandrake Control Center, and it gets added to resolve.conf, but doesn't solve my problem.
I can't find "DHCP" or "dynamic" in the indices of the two huuuuge Linux books I have. And I'm lost.
What tools/programs/commands do I need to run, or files to look at, to see what my current configuration is? What should I look for in that information? Does anybody have a magic wand? :-)
With windows, name resolution is done through netbios I believe. Most of the time we don't even realize it is taking place.
With Linux, you have to be a little more adapt at configuring things. Since you only have two hosts and a router, I would use the /etc/hosts file. You are wondering how you are supposed to do that with dynamic dhcp right? Two options:
1) setup your router to give out the same address to a computer every time. Then add their assisgned ip to your /etc/hosts file and you are ready to go. You don't need to worry abou the ips changing because you are the network admin. This has the advantage of being both dynamic and static
2) setup the machines with static ips and can dhcp. Probably just as easy since you don't have a very big network.
It is possible that your DHCP server is also running a DNS server. In this case, you could simply include a line such as "nameserver 192.168.0.1" in /etc/resolv.conf". If not, find out where the DNS server is and point resolv.conf to that. I'm surprised that dhcpcd hasn't automagically setup name resolution for you, if it's being done by the same machine that's doing the DHCP service.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.