mDNS Name Resolution

Today I made mDNS name resolution work, but first a little background about my network. I have a desktop PC called eddie, a laptop called hactar, a Netwinder cunning called netwinder, and an iPaq h5500 called ipaq. All of these machines connect to a wireless ADSL router and ask it for an IP address using DHCP, it gives them one and the DNS server, and all is good... until I want to ssh into the Netwinder from my laptop, and then scp files onto the iPaq, as I don't know the IP addresses.

Until now my solution has been to do a broadcast ping with ping -b 192.168.10.255 and try the IPs which respond, but now I've finally found a sane mDNS name resolution plugin for NSS. This is trivially installed and configured (add mdns4 to the hosts line in /etc/nsswitch.conf), but depends on a mDNS responder to be running on each machine. Luckily, Howl is currently in Debian (though not for long), so after quickly installing it on all of the machines to my surprise it Just Worked:

ross@hactar ~
$ getent hosts netwinder.local
192.168.10.104  netwinder.local
$ getent hosts ipaq.local
192.168.10.105  ipaq.local
    

Excellent!

NP: Vertigo, Groove Armada

14:26 Thursday, 03 Mar 2005 [#] [computers] (8 comments)

Posted by Carl-Christian Salvesen at Thu Mar 3 16:02:42 2005:
Or you could just do it with bind and dhcpd on any linux-box..

dhcpd.conf:

ddns-update-style ad-hoc;
subnet 192.168.0.0 netmask 255.255.255.0 {
  option routers 192.168.0.1;
  option subnet-mask 255.255.255.0;
  option broadcast-address 192.168.0.255;

  ddns-updates on;
  ddns-domainname "lan";
  ddns-rev-domainname "in-addr.arpa";


  option domain-name "lan";
  option domain-name-servers 192.168.0.2;
  default-lease-time 600;
  max-lease-time 7200;

  key mykey {
  algorithm hmac-md5;
  // Same secret as in /etc/bind/named.conf
  secret "";
  };

  zone lan. {
  primary 192.168.0.2;
  key mykey;
  }

  zone 0.168.192.in-addr.arpa. {
  primary 192.168.0.2;
  key mykey;
  }
  range 192.168.0.100 192.168.0.120;

  default-lease-time 600;
  max-lease-time 7200;
}


named.conf:
<code>
key "mykey" {
  algorithm hmac-md5;
  // Make the secret below with <some util i can't remember> ;)
  secret "";
};

options {
  directory "/var/bind";
  listen-on-v6 { none; };
  auth-nxdomain yes;
  pid-file "/var/run/named/named.pid";
};

zone "." IN {
  type hint;
  file "named.ca";
};

zone "localhost" IN {
  type master;
  file "pri/localhost";
  allow-update { none; };
  notify no;
};

zone "0.0.127.in-addr.arpa" IN {
  type master;
  file "pri/127.0.0";
  allow-update { none; };
  notify no;
};
zone "lan" {
  type master;
  file "pri/lan.zone";
  allow-update { key mykey; };
};

zone "0.168.192.in-addr.arpa" {
  type master;
  file "pri/lan.reversed";
  allow-update { key mykey; };
};
</code>
Posted by Ross at Thu Mar 3 16:06:27 2005:
If I had a linux box which was always on, yes.  The point is that at any given moment none or all four of the computers could be on.  The only thing which is always on is the router, which is terrible and won't run Linux or a DNS server.
Posted by Simos at Thu Mar 3 16:07:51 2005:
Oh, there are access points that do not support predefining the IP address for specific MAC addresses.. :(
Posted by Paul Brossier at Thu Mar 3 18:03:36 2005:
Hey Ross.

Unfortunately, mDNS Responder is licensed under the APSL, and hence it will soon be removed or make the move to non-free (see Bug#289856).

The rest of howl is fine though, so maybe someone (Porchdog?) will bother rewritting it at some point.
Posted by Simon at Thu Mar 3 20:51:01 2005:
Hi Ross,

I have needed a solution to exactly this problem for  months. Looks like all that time idled away reading Planet Gnome has paid off. Thanks!
Posted by Simon at Thu Mar 3 20:51:29 2005:
Hi Ross,

I have needed a solution to exactly this problem for  months. Looks like all that time idled away reading Planet Gnome has paid off. Thanks!
Posted by Ross at Fri Mar 4 09:22:41 2005:
Paul: yes, I know all about the Howl issue, being involved in the GNOME team who has a Howl dependency at the base of the library stack.  I probably should have linked "though not for long" to the bug#.
Posted by Andre Kretynian at Mon Mar 7 17:27:16 2005:
Wszyscy to glupki, ja mam najglebsza wiedza

Name:


E-mail:


URL:


Add 9 and 10 (required):


Comment: