Page 1 of 1

How is http://b3 resolved

Posted: 26 Nov 2013, 12:57
by drdr6
Having trouble resolving http://b3 (per manual, and nice feature)
Recently switched to opendns, so have touched dnsmasq.conf & resolv.conf.
Didn't see b3 mentioned there anywhere so wondering where "b3" as a domain gets resolved to localhost in the default setup on a b3.

Thx
Derek

Re: How is http://b3 resolved

Posted: 26 Nov 2013, 13:14
by RandomUsername
It should be in /etc/hosts and the default config for dnsmasq is to serve addresses for domains listed there before it forwards requests to external DNS servers.

Re: How is http://b3 resolved

Posted: 27 Nov 2013, 04:43
by drdr6
Odd, since this is what I saw after installation and basic config in my hosts file

127.0.0.1 localhost.localdomain localhost
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

i.e. no mention of "b3". I've forced it to resolve by adding the line

address=/b3/127.0.0.1/

to my dnsmasq.conf, but I wanted to know where it was supposed to have been set

The reason I got into this was switching to opendns, I started looking at logs and am seeing *.localhost listed there as resolving at more than 10x the rate of all the other domain lookups my box is doing. opendns won't disclose what '*' is in this context, but turning on dnsmasq logging, one key culprit was isatap.localdomain - which is an MSFT Vista/7/8 IPv6 tunneling thing I don't pretend to understand. After waiting around some time I also saw references to a lot of my local machines such as "storage" showing up as having gone out for resolution as "storage.localhost" and been resolved by opendns to a non-existent domain (but having taken time to do so obviously)

Re: How is http://b3 resolved

Posted: 27 Nov 2013, 05:00
by RandomUsername
Something borked then. This is mine (after changing hostname in the web interface):

Code: Select all

127.0.0.1       localhost.localdomain   localhost
::1     ip6-localhost   ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
192.168.10.1    serverb3.localdomain    serverb3
Also, are you on a dynamic public IP address? If so, you will have a problem of your DNS servers switching back to your ISP's every time your IP address renews. You need to make the following changes to /etc/bubba/dhclient.conf:

Remove "domain-name-servers" from this line:

Code: Select all

request subnet-mask, broadcast-address, time-offset, routers,
                domain-name, host-name,
                netbios-name-servers, netbios-scope;
And add the following line underneath:

Code: Select all

supersede domain-name-servers 208.67.222.222, 208.67.220.220;

Re: How is http://b3 resolved

Posted: 27 Nov 2013, 06:27
by Gordon
Another trick you could use is to add the following line to dnsmasq.conf (or dnsmasq.d/something.conf)

Code: Select all

resolv-file=/var/lib/dnsmasq/resolv.conf
In that case receiving new DNS servers from DHCP will not change which servers DNSmasq uses for reference.

the location /var/lib/dnsmasq/resolv.conf is just an example

Re: How is http://b3 resolved

Posted: 27 Nov 2013, 09:00
by drdr6
Thanks for all the suggestions.
So in hosts file, you'd recommend (for a vanilla conf example)

Code: Select all

192.168.x.x    b3.localdomain    b3
(where x.x is obviously what one picks for the local network) ?

For the DCHP piece, I don't quite get DCHP'd since I'm using a Drayek 120 in bridged mode to connect PPPoA as PPP and so I have (in dnsmasq.conf)

Code: Select all

no-resolv 
uncommented and

Code: Select all

server=208.67.222.222
server=208.67.220.220
as my DNS servers (OpenDNS), So that's all ok, and it looks like

Code: Select all

local=/localdomain/
local=/isatap.localdomain/
have silenced to random callings to *.localdomain out on OpenDNS servers, just a bit concerned that Windows clients are still not going to be entirely happy with the world.

Until yesterday I was blissfully unaware of "isatap", but I also see "wpad" floating about unanswered and wondered if there was a good primer for all the basics of DNS resolution beyond /etc/hosts, taking into account MSFT generated stuff

Re: How is http://b3 resolved

Posted: 27 Nov 2013, 09:15
by RandomUsername
wpad is a potential securiity hole is if you're on a domain with a two-tier TLD (e.g. xyz.co.uk). See here for why: http://en.wikipedia.org/wiki/Web_Proxy_ ... l#Security

Re: How is http://b3 resolved

Posted: 27 Nov 2013, 12:19
by drdr6
Good note. Fortunately not me:

Code: Select all

Nov 27 07:56:13 b3 dnsmasq[789]: query[A] wpad.localdomain from 192.168.2.72
Nov 27 07:56:13 b3 dnsmasq[789]: config wpad.localdomain is NXDOMAIN-IPv4