• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

DHCP and DNS *updated with WINS questions (long)*

cleverhandle

Diamond Member
I'm setting up some Linux machines on a Windows network which is out of my control. I can get the DHCP info just fine, and provide the clients with all the information they need to access the Internet. But the clients' hostnames are not resolvable internally. Is this a problem on my end or a consequence of the DNS implementation on the network? I can resolve hostnames (pinging by name) between Windows machines just fine, which I suspect is because WINS, not DNS, is handling those lookups. Is there anything I can do on the client end to make the Linux boxen recognize each other by name?

Obviously, I don't have much experience with DNS - I'm trying to get a little perspective here and make sure I'm not totally misreading the problem.

UPDATE: OK, after some mucking about, I've managed to get the Linux machines to handle name resolution through WINS, usable for all IP operations. For those interested, the key is libnss_wins.so (different than libnss_winbind.so), which is part of Samba, but not built or installed by default. A make wins will build the component. It can then be dropped into /lib, and specified as "wins" in nsswitch.conf. None of this is really documented anywhere as far as I can tell, so hopefully this will help someone else.

I still need some advice, but I should probably give a little more info first. I'm a high school teacher, and I sponsor a club of computer geeks working on various projects. One of them is to build a Linux terminal services network using old machines incapable of running recent Windows versions. The network is a 10.x.x.x run by the State Board of Ed, with our school on a 12-bit subnet of it. Now, it would be nice if our DHCP server (owned by the Board) passed updates to DNS (also owned by the Board), but it doesn't. Most likely, there's someone who could help me reserve an IP or two, but my Assistant Principal (the local "tech honcho") gives me glassy stares at the mention of such obscurities as DNS and subnets. And without his help, I won't get far with Board people. Given that background, here are my needs/wants:

1) Clients must be able to find the server by name, without a static definition in /etc/hosts. Obviously, this is essential.

2) The server should be able to find the clients by name. Not so essential, but it would make remote administration much, much easier.

3) The clients should be able to resolve each other by name. Not that important, since the clients don't have any reason to speak to one another. Would be nice for completeness, though.

4) The clients might be able to resolve Windows machines by name. Unimportant at the moment. And if it does become important, getting resolution on the server should be adequate.

OK, then. As I said, I've gotten libnss_wins to work, so I could point the machines to the WINS server address, which would handle all of the above. But I'm not sure I like that solution - the WINS server is not local, and I don't know if it's IP will change (it doesn't look like a "special" address that would be reserved). I'd prefer not to be dependent on the Board's network configuration if possible. So I was thinking about a different solution - first, modify the client boot scripts to grab the server's address via nmblookup broadcast and edit that line in /etc/hosts. This would handle #1, without any static information on the clients. If the server went down, the client would need to reboot, but that would have to happen anyway for other reasons. Second, set up nmbd on the server to act as a WINS server, and point the clients to it. This would handle #2 and #3. Important Question: Will adding a WINS server to our subnet interfere with it in any way? My impression from the MS docs is that clients must be specifically configured to find a WINS server, either manually or through DHCP, so the answer should be no. But I certainly don't want to cause network troubles. That only leaves #4, which I'm willing to let go. The most I should ever need is access to one or two particular servers, which I can handle on our server with nmblookup if necessary.

My biggest concern is whether setting up our server as a WINS server will interfere with normal operations, but if I'm missing an obviously simpler solution, I'd welcome suggestions. Thanks for reading --
 
Do you even have samba installed and started and configured to support WINS? Does the DHCP server provide the WINS server address?

This:

[global]
wins server = <ipaddress>

needs to be in smb.conf (or may be gotten from DHCP), and I think "wins support = yes".

When you use regular Windows networking, the NetBIOS name is broadcast regularly on the network. When you use WINS, the WINS server is given the name once and used for lookups. Only if the server is unreachable does the name get broadcast.
 
Hmm... I hadn't thought of using Samba. So I could point the machines to the master WINS server and they could resolve one another through that. But would that work for, say, ssh'ing between 2 Linux machines? I was under the impression that the Linux boxen would only use WINS/nmbd for SMB operations.
 
Samba is just the Linux feature used to emulate Windows networking, which uses NetBIOS for names rather than DNS. I don't know if you can use ssh to connect to another machine using the name without DNS, since SSH normally uses IP addressing or a domain name resolved through DNS; the NetBIOS name may not be usable. However if the WINS server does provide the IP address of the other machines when a lookup is done, then it ought to work just fine because you'll be able to get the IP for the name, just like with DNS.

What did you think you'd be able to do without using Samba? That's the only way to make a Linux machine "see" Windows machines. SMB is just the Linux way of interfacing with NetBIOS and the naming functions of it. Samba is used for broadcasting the Linux machine's NetBIOS machine and listening for other machine name broadcasts.

A WINS server acts like a DNS server, with each machine registering itself every time it boots. Then the other machines do lookups on the server just like a DNS server.
 
Do Linux clients use the dynamic DNS updates like Win2K clients? (using Win2K DNS servers). You could manually enter the A and PTR records on the DNS server for your clients.
 
This can be easily solved by configuring SMBD and NMBD from Samba on the client linux machines.
The Samba howto covers this among other things, but once NMBD is running, it's as trivial as smbclient \\\\hostname etc..

What kind of situation would you be in where you are connecting to a Windows SSH host from a linux box? For file transfer and etc, smbclient acts like a Windows filesharing FTP client, and if you've enabled support for it, mount -t smbfs will allow you to effectively mount the remote drive (this works pretty well).
 
Samba is mostly irrelevant. You can setup winbindd on all of the Linux clients so they can use WINS, but it would be better to get a proper DHCP/DNS setup going. It's not difficult to setup the DHCP server to do dynamic DNS updates (this way you don't trust the clients to do updates, which can be bad).
 
Sorry, I guess I'm not being clear... I don't need to access the Windows machines from the Linux machines or vice versa. All I'm asking is if I can get two Linux machines to resolve one another's names. From what I had read before, and what Nothinman said, it seems the best way would be to setup the DHCP and DNS servers to dynamically update their information. Unfortunately, those servers are completely out of my control. I haven't heard of winbindd - I'll look into that and post back.
 
Aha! Winbindd looks (relatively) perfect for this situation. For those unfamiliar with it, as I was, it's another Samba service that handles lookups of various info (users, groups, hosts) from a WINS server, and can be specified as a resource in the standard nsswitch.conf entries. Yes, real dynamic DNS would be better, but that's not in my power, so this looks like a plan. As long as I'm only getting hostnames and not sharing files/printers, can I just run winbindd and nmbd, or will I need smbd as well?
 
What you're describing can be done if you run your own linux-based DNS server on said network. Bind would give you much greater naming control over everything. From the sounds of your network setup, you would probably have to set this up separate from the rest of the school's, and knowing how most schools that doesn't sound like a great possibility.

Easily done though, if you statically configure all your DNS settings, which shouldn't be too big a deal unless the school's DNS servers change frequently.

From the sounds of it, I envy your students. 🙂
 
Back
Top