access computer via name without editing hosts file?

Austin Godber godber at uberhip.com
Mon Dec 24 15:40:23 MST 2007


If they are all on the same LAN (which it sounds like they are) you can
use MulticastDNS/mDNS/Rendezvouz/Bonjour to access hosts with the .local
extensions.

The Macs already have this capability ... for instance try pinging
mac1.local from mac2.local.

The daemon in Linux that handles this is called avahi (common in recent
distributions).
godber at monk:~$  ps auwx | grep avahi
avahi     5985  0.0  0.0   2848  1500 ?        Ss   Dec06   0:02
avahi-daemon: running [monk.local]
avahi     5986  0.0  0.0   2732   460 ?        Ss   Dec06   0:00
avahi-daemon: chroot helper
godber   12593  0.0  0.0   2972   748 pts/6    R+   15:35   0:00 grep avahi

You can see above that the line with avahi and running shows that this
machine will respond to monk.local.

With avahi running the Linux machines will RESPOND to mDNS requests but
not use them for name resolution.  To handle that you need nss-mdns
installed.  In Ubuntu the package is called libnss-mdns and sets
everything up automatically.  Typically you will need the appropriate
package installed and extra info in your /etc/nsswitch.conf file ...
heres what mine looks like:

godber at monk:~$ grep hosts /etc/nsswitch.conf
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

Lastly, your Windows machine isn't out of luck.  Apple kindly makes an
extension for Windows OSes (YMMV, but it has worked well with XP for
me).  The following package sets up both the responder service and name
resolution bits:
http://www.apple.com/support/downloads/bonjourforwindows.html

Good luck,
Austin



Matrix Mole wrote:
> I've got a network of about 7 computers all running various OS'es (2
> gentoo, 3 mac, 1 slackware, 1 windows). Around 4-5 years ago when I
> first put this network together I was able to access any of the
> computers by their assigned computer name. For some reason when I
> performed a router bios upgrade (using a D-Link at the time) I lost that
> ability and from then on, was required to use either IP address or edit
> the hosts file on every computer. This became extremely frustrating
> when, for whatever reason, a computer would pull a different IP address
> from the router. At that time I just went into the router config and
> hard coded all the IPs so that I wouldn't have to worry about the
> changes and could keep my hosts files intact. Since then I've removed
> the router from the network, replacing it with my k6-2/350 Gentoo box.
> On the gentoo box I'm usin dnsmasq as my DNS forwarder/resolver for the
> network, along with acting as my DHCP server. I was under the impression
> from my reading of the dnsmasq man pages and tutorials that it would
> allow me to browse my local network via name resolution without
> requiring to manipulate the hosts file on my various computers, but no
> such luck. It appears that when I issue a request for a computer by
> name, the actual request never even goes out onto the network, it checks
> the local hosts file and if it's not there it merely spits back that the
> host does not exist. Is there some way to force the local machines to
> look at the DNS resolver on my router to get the IP of a computer based
> on it's name? Do I need to use machine.localnet or somesuch dot'ed
> notation to force it to look out on the network for the machine names?
> 
> Matrix Mole
---------------------------------------------------
PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss



More information about the PLUG-discuss mailing list