LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Linux machine not reporting hostname correctly (https://www.linuxquestions.org/questions/linux-networking-3/linux-machine-not-reporting-hostname-correctly-770079/)

MJBoa 11-18-2009 06:54 PM

Linux machine not reporting hostname correctly
 
So I have a linux machine that I'd like to report its hostname correctly so it can be identified on a list of machines connected to my network.
I have /etc/hostname set and hostname correctly reports what it is. But it seems not to report this to other machines that ask for it.
For example, the command nslookup <my ip> reports NXDOMAIN basically meaning, from what I gather, that it couldn't find a hostname. Yet when I run nslookup <other windows machine ip> it correctly reports the hostname for the Windows machine.
What do I need to set up in order to have it be identifiable by its hostname? Do I need a DNS server and does Windows automatically run one?
Thanks.

MS3FGX 11-18-2009 07:00 PM

You need DNS for that. Windows doesn't run DNS by default but does use WINS which is a proprietary distributed method of name discovery. Basically Windows machines just broadcast their hostname out to anyone who is listening.

You can get WINS support on Linux by installing amd configuring SAMBA to use WINS name resolution.

Alternately, if these machines are connected to a home router doing DHCP/DNS, your Linux machine might not be passing it's hostname to the server in the boot scripts. But the installer in most distros would have asked you about that.

MJBoa 11-18-2009 07:22 PM

So all I want my machine to do is report itself as <hostname>. I don't want other machines to be able to request DHCP leases or DNS lookups for any other systems.
I tired setting netbios name = <hostname> in /etc/samba/smb.conf but this seems to have no effect.
Although I have a static IP, I don't think that should matter though.
So should I be running dnsmasq? Can I make it only report my hostname when asked and not do anything else?

Ippy98 11-19-2009 06:08 AM

The way other machines would see your hostname is through DNS.

You could try statically adding the hostname of your linux box to your \etc\hosts file in windows.


Its usually in
c:\winnt\system32\drivers\etc\hosts
or
c:\windows\system32\drivers\etc\hosts


or you can run a local DNS that would do DNS just for your local network, and your router would still do DNS for your internet connection.


All times are GMT -5. The time now is 12:16 AM.