Convice Bind to listen on IP alias with a range of IPs.

Augie Schwer augie.schwer at gmail.com
Tue May 1 21:32:17 UTC 2012


On Tue, May 1, 2012 at 2:00 AM, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
> Which operating system are you running?

Linux, I'm sorry I did not mention that earlier as it may have saved
some confusion.

> Contrary to what a lot of other people have suggested, it is in fact
> possible using the socket API to bind() to IPs which aren't explicitly
> created, due to special handling on the loopback interface. This can
> certainly be done under Linux, for example., and I have just re-confirmed
> that to myself.

Thank you for confirming for others that this is a real feature.

> Unfortunately, it seems likely that named is using the normal socket APIs to
> first enumerate the list of IPs on the box, and then filter those through
> listen-on statements to get the final list of IPs to pass to a bind() socket
> call - this would be a sensible way to implement the CIDR listen
> functionality.
> If so, then if the IP isn't *explicitly* on an interface, it won't appear in
> the final output set, regardless of the fact a bind() call will succeed.

OK, that makes sense, I have found that the following work-around does work:

sudo ifconfig lo:1 10.0.0.1 netmask 255.255.255.224
sudo ifconfig lo:2 10.0.0.2 netmask 255.255.255.255

I get the full usable range on my loop-back interface, and Bind will
happily now listen-on the 10.0.0.2 address.


-- 
Augie Schwer    -    Augie at Schwer.us    -    http://schwer.us



More information about the bind-users mailing list