OBiTALK Community

General Support => Installation and Set-Up (Devices) => Topic started by: JohnBowler on August 03, 2012, 10:38:33 AM

Title: Setting host names for OBi202 DHCP clients
Post by: JohnBowler on August 03, 2012, 10:38:33 AM
If, like me, you use an OBi202 as your internet gateway you probably also use it to provide the central DHCP and DNS management services for your network.  The problem with this is that many basic networking and consumer products, like switches and televisions, which work fine with DHCP to connect to a network fail to send a host name when they connect.

This means that when you look at the "LAN status" page in www.obiconnect.com many DHCP clients have "*" as their name.  In turn this means that when you try to connect to one of your devices you have no name to use and it is necessary to go into the OBi202 Lan Status page and try to guess which device is which.  This, of course, sucks.

The fix for this consists of using the "DHCP reservation" facility to set both a fixed IP address and a host name for each client you need to access via the web.  While the first part (setting a fixed IP address) is documented in the manual (the "OBi Device Administration Guide", page 63) the manual doesn't say how to set a host name.

The obvious way to do this is to set "Local DNS Records", as on page 60, to augment the host records the 202 already sets up (www.obiconnect.com and obiconnect.com) to refer to itself with a consistent name.  The problem with this is that not only does it not work it as documented it also can cause your Obi202 to crash with certain apparently valid domain names (specifically ones with a trailing dot.)  OBi support are unable to explain the syntax or what the option actually does...

The answer is actually simpler than writing stuff to indirectly associate the IP with the host name.  Because the DHCP reservation stuff simply generates dhcp-host records for dnsmasq, as documented here:

http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example

Normally the format is this one:

dhcp-host=11:22:33:44:55:66,192.168.10.60

And the obiapp dialog restricts the latter part, the IP address, so that only the last byte can be set.  However there is no restriction (apparently) on the first part, the ethernet MAC.  So to set the host name in the above example to, for example, "fred", enter "fred,11:22:33:44:55:66" and instantly "fred" (or "fred.yourdomain.com") can be used to refer to the device.

John Bowler <jbowler@acm.org>