Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a LAN setup with a bunch of windows and linux boxes. The LAN is built on top of the AT&T DSL Router. I don't have any type of DNS Server running. All the windows machines can identify themselves by machine name over the network. Even a Linux NAS box can also be accessible by machine name. However, I recently built a CentOS linux box and I want it to be accessible by machine name. I've tried setting the hostname but it does not work. Can someone help me with this problem?

share|improve this question

migrated from stackoverflow.com Jun 6 '11 at 20:34

This question came from our site for professional and enthusiast programmers.

add comment

5 Answers

If you run Samba on the Linux box, you should be able to access the Linux box from the Windows boxes, by using the Linux box's hostname.

(There is a lot more to it than that, but that's the simplest solution)

share|improve this answer
add comment

I think, there are two options:

  • Manually creating an /etc/hosts and distributing it on the different machines (takes a lot of maintenance), see http://en.wikipedia.org/wiki/Hosts_%28file%29

  • locally installing a small DNS server, e.g. dnsmasq. dnsmasq can also work as a DHCP server and will include the hostnames that it records via DHCP in its DNS replies

Maybe, the AT&T box also has some local DNS features? I don't know that box, though.

share|improve this answer
    
It is Netopia 3000. If it helps. I could not find anything useful though about this box, which can help me. –  user766453 Jun 6 '11 at 19:03
add comment

I'm going to assume you're using DHCP, and that the clients are sending their hostname to the DHCP server, which is updating a local DNS server (try nslookup ${somehostname} to verify the server address).

CentOS5 does not, AFAIK, send the hostname over DHCP by default. Add:

DHCP_HOSTNAME=${yourhostname}

to /etc/sysconfig/ifcfg-eth0.

If it's a static IP, see the hosts file, dnsmasq, BIND, or some Windows-based DNS server. Caveat: your router is probably functioning as a DNS server, so you'd need to make some client configuration changes if you set up a local DNS server in order to have them look at it first.

share|improve this answer
    
I am getting "server can't find ${yourhostname}: NXDOMAIN" error. Although this command does display the router IP correctly. Also, DHCP_HOSTNAME is also set correctly in /etc/sysconfig/networking/devices/ifcfg-eth0. –  user766453 Jun 6 '11 at 21:47
    
I Found this to be the most reliable and efficient solution if you are using your own DNS server (we use DNSmasq). This eliminates need for any external packages to enable name resolution even from Windows hosts. By the way this is what I put into our config: DHCP_HOSTNAME=$HOSTNAME –  Lukasz Jan 29 '13 at 23:51
add comment

windows hosts are accessable by name because they can be found by their netbios name http://en.wikipedia.org/wiki/NetBIOS

For your linux box you can:

  • Add a dns server
  • Install samba and configure it to use netbios name
  • Add ip/name of your linux machine to other box in your lan (/etc/hosts if linux, c:\windows\system32\drivers
share|improve this answer
    
Installing samba did solve the problem. –  OutputLogic Feb 1 '12 at 21:55
add comment

A bit old here but i answer anyway :

[global]
  workgroup = smb
  netbios name = SERVEUR
  security = share
  share modes = yes

[homes]
  comment = Home Directories
  browsable = no
  read only = no
  create mode = 0750
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.