[Dnsmasq-discuss] server-side dynamic resolving

Chris Wilson chris+dnsmasq at aptivate.org
Mon Aug 13 15:39:04 BST 2012


Hi Travis,

On Sun, 12 Aug 2012, Travis Hansen wrote:

>> Do you control the DNS for the foobar.dev zone, and is it hosted by a 
>> full DNS server (not dnsmasq)? If so, just put a CNAME in the zone 
>> file:
>>
>>         15z IN CNAME 15z.local.
>
> I'm not a dns expert but I doubt this will work either since I'm 
> guessing something like bind is using pure dns lookups and is not 
> capable of using the system resolver(s) (mdns) to find an IP.

Bind doesn't do it, the client does. CNAME works like this:

client -> nsswitch -> server: what's the address of 15z.foo.bar?
client <- nsswitch <- server: 15z.foo.bar is a CNAME to 15z.local.
client -> nsswitch -> mdns: what's the address of 15z.local?
client <- nsswitch <- mdns: 15z.local is at 1.2.3.4

This assumes that nsswitch on the clients is configured to use mdns as 
well as dns, which on my system (Ubuntu 11.10) it is.

>> If not, and 15z registers itself with the dnsmasq DHCP server, then you can
>> bypass ahavi/mdns and just CNAME 15z.foobar.dev to the machine 15z in
>> dnsmasq config:
>>
>>         cname=15z.foobar.dev,15z
>
> This is actually what I tried initially but it was
> "cname=15z.foobar.dev,15z.local".

The documentation says that's not allowed. It has to be a name that's 
registered in /etc/hosts or by a DHCP client.

> What I'm up against here (why I can't use cname=15z.foobar.dev,15z) is 
> we have multiple laptops that float around from being plugged in to 
> wireless each with different IPs depending on the nic.  What that 
> equates to in dnsmasq terms is static leases but not for '15z' but 
> rather '15z-wifi' *and* '15z-eth0' for example.

Do you have to use static leases? Can't you just let dnsmasq allocate the 
same IP to the client based on its hostname/client ID, whatever 
connection/MAC it's using?

Cheers, Chris.
-- 
Aptivate | http://www.aptivate.org | Phone: +44 1223 967 838
Future Business, Cam City FC, Milton Rd, Cambridge, CB4 1UY, UK

Aptivate is a not-for-profit company registered in England and Wales
with company number 04980791.




More information about the Dnsmasq-discuss mailing list