Another Linux Question...

This post was originally going to go in MPSIMS to say “Yippee, I have now installed RedHat Linux 7.3 at home and at work”. As it turns out, I have a question that I will post here among my buds before I go to the newsgroups.

At home, I have a Linksys router, 4 port switch, and wireless access point. I have DHCP turned on, and I have my Linux machine set to obtain IP address automatically. No problem so far. I can ping the linux box by ip address from any of my windows machines. When I look at the DHCP table on the switch, all my windows machine show up by name (and IP address of course), but my linux machine doesn’t show a machine name. Isn’t there a way to broadcast that that machine name to the switch at boot time from the Linux machine? (assumption on my part that windows is doing that)

Anyone have any answers? All help is appreciated.

E3

Do you have Samba installed and configured? I would offer a WAG that the name you are seeing from the windows machines is the SMB name, offered by windows networking, and you’ll need samba configured to get a name to show up. That I know of, without a DNS server, there is no protocol in straight TCP/IP to broadcast a machine name. I could easily be wrong. Just my guess.

Hmm, that’s worth looking in to if it’s that important to me (I’ll have to think about that). I thought Samba was just a means to share resources on my Linux machine… i.e. If I had a printer on my Linux machine that i wanted to be accessable to my windows machines, or if I wanted to have common disk space.

To answer your questions (which is obvious now), No, I don’t have Samba configured. I figured I would get around to that later, as needed. Maybe “as needed” is now.

So, the big questions remains… where does my DHCP server obtain the computer names? Would it matter if I set some or all of my networked machines to static IP addresses? Anyone have any more knowledge to share? Thanks Etherman.

E3

DHCP by itself has nothing to do with computer names. SMB does include a naming system. That’s how you see names in “Network Neighborhood”. I would concur that it is most likely that your router speaks SMB well enough to pick up names that way, and that Samba would probably make a name show up for your Linux box.

Is there any particular reason that this is important to you to be able to see these names in your router?

Thanks, Undead Dude. (Hey, we registered on the new sdmb around the same time.)

Actually there are two reasons.

  1. Because I’m an anal retentive asshole that always tries to screw up productive work in progress by getting bogged down in some minutia crap that probably doesn’t matter. It’s my trademark as a software developer, and I hate it. I’m trying to learn to just ‘let it go’, but as always it bugged the crap out of me when I noticed it, and I realized I didn’t know what/why/how the machine names end up in the DHCP table.

  2. This actually began, when I was testing my network connectivity after I installed RH7.3. I was able to ping via IP address (obviously), but not by machine name, and it started driving me nuts.

So, in a sense, by you asking ‘why this was important’ you made me step back and look at the big picture, which makes me want to repost my original question to something like “Why can’t I ping my linux box by machine name?” and that sounds very Samba related from what little I know about Samba.

To step back even further… (wow this is cool, I need to do this more often), I could even ask myself, why is it important to be able to ping my machine name? Uh… [looking down at feet] I dunno, I just wanted to be able to. The real goal is to eventually setup and run apache and teach myself about apache, CGI, perl, etc. etc. As a programmer who’s web development experience has been on the Microsoft side only (asp et. al.), with one project using java. I want to expand my horizons because you can never tell in today’s job market.

So to that end. Any and all comments and advice are generously welcome.

E3

Well, lets answer that question. Why can’t you ping by machine name? That’s because your machines don’t have DNS. That SMB name may be one way of throwing a name out onto a network, but it isn’t the way that names are resolved into IP addresses. You need DNS for that.

Undoubtedly the IP addresses that your router is supplying are private IP addresses (something like 192.168.1.x). Since these are private addresses, there is no public DNS for them.

You could do what I did-- stand up a private DNS server or 2 within your network. RHL 7.3 undoubtedly comes with a BIND rpm. There was a complication for that with me tho. My Linksys router (which is undoubtedly older and less feature rich) would not allow me to specify what DNS servers to broadcast to my private network. It would only rebroadcast the DNS servers that my ISP supplies.

If you ran into the same problem, to deal with that, you could change your computers to hard code the DNS server(s) that you choose to put up.

I chose instead to turn DHCP off on my router and run it instead on one of my linux boxes, so that I could get a more feature-rich DHCP service.

Of course since it sounds like you are saying that you can ping your Windows boxes by name, perhaps the Win-based ping prog does the SMB thing in addition to DNS. Unix-ish ping programs aren’t going to do that. Also, as you said, you intend to add services to the Linux box such as web. I’m guessing that you probably can’t ping your Windows boxes by name from your linux box unless you have made special appropriate entries in /etc/hosts. Chances are that a browser will need DNS if you want to enter a url by name.

However, saying something about /etc/hosts did remind me that there is some sort of Windows equiv to /etc/hosts-- where you can hardcode names for IP addresses. I’m afraid I can’t elaborate as I never really did delve into Win administration very far. :slight_smile:

If you use a “hosts” file, those names will also not move with your computer if your computer picks up a different address via DHCP, so any system that you want to run services on should probably have a static address. The same is true for DNS unless you want to allow clients to make dynamic updates. I believe W2K and XP have the ability to request dynamic DNS updates.

On my network, as I said, I am running DHCP from linux. I record MAC addresses for all of my systems in the DHCP config and supply all known computers with static addresses over DHCP. I still maintain a dynamic range of IPs to allow for a friend to come over with a laptop and be able to just plug in.

Thanks again for the reply, Undead Dude.

Unfortunately I’m not at home right now. I can’t wait to get home and start looking into this more.