[Dnsmasq-discuss] server-side dynamic resolving
Travis Hansen
travisghansen at gmail.com
Sun Aug 12 15:26:09 BST 2012
Chris
On Sun, Aug 12, 2012 at 3:48 AM, Chris Wilson <chris at aptivate.org> wrote:
> Hi Travis,
>
>
> On Sat, 11 Aug 2012, Travis Hansen wrote:
>
>> I'm attempting to integrate dnsmasq with mdns. I'm not really sure
>> how to go about it but I'll explain the scenario...
>>
>> 1. My machine is known as '15z' and via mdns clients resolves as 15z.local
>> 2. I have apache running mod_dnssd (not actually critical to the
>> situation but gives context at least) with a virtual host
>> 15z.foobar.dev
>> 3. I'd like to make it so 15z.foobar.dev gets returned by dnsmasq as
>> whatever the current value of 15z.local is (the server is running
>> avahi).
>>
>> Anyone have any great suggestions for me? I've thought about
>> combinations of entering cname records into dnsmasq and somehow trying
>> to integrate that but ultimately
>
>
> 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. If I
can do that then I'd just need to figure out how to get bind and
dnsmasq on the same machine without clobbering each other. If you
know of some sort of dns proxy that will simply return/cache whatever
the server resolves vi nsswitch let me know what it is as I'd like to
try it.
>
> 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". 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. Avahi just picks the 'best' current IP to broadcast but I
can never be sure which one it'll be from a purely dns/dhcp
standpoint. Anyway, this is particularly where I hit the issue and
realized that dnsmasq is *just* attempting lookups via hosts files and
dhpc leases and not additionally (or only) attempting nsswitch which
would obviously generally include the system's dns servers among other
things. If there were some way to achieve that I'd be set :)
>
>
>> I couldn't get dnsmasq to return what the local *server* resolves a given
>> name too (limited to just hosts/dhcp/upstream dns).
>
>
> You probably can't do that without programming, so I suggest you find other
> ways to achieve what you want first, such as CNAME.
>
>
>> I'd rather not run stuff client side.
>
>
> With a CNAME you don't need to run anything other than a standard resolver
> on the client side, which most likely you already do.
>
> 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.
>
--
Travis Hansen
travisghansen at gmail.com
801.367.2715
More information about the Dnsmasq-discuss
mailing list