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

michoski michoski at cisco.com
Tue May 1 03:06:38 UTC 2012


On 4/30/12 4:14 PM, "Augie Schwer" <augie.schwer at gmail.com> wrote:
> I think you've all missed the netmask there, 10.0.0.2 is in that range.
> 
> augie at augnix:~$ sudo ifconfig lo:1 10.0.0.1 netmask 255.255.255.224
> 
> augie at augnix:~$ ifconfig lo:1
> lo:1      Link encap:Local Loopback
>           inet addr:10.0.0.1  Mask:255.255.255.224
> 
> augie at augnix:~$ ping 10.0.0.2 -c 1
> PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
> 64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.027 ms
> 
> --- 10.0.0.2 ping statistics ---
> 1 packets transmitted, 1 received, 0% packet loss, time 0ms
> 
> Given all that, can anyone suggest a reason why Bind won't listen on
> that address?

No, we all saw the netmask.

A few tried to point out the answer...you first need to get the desired
aliases UP on the system for BIND to listen-on.

For example, loopback is 127/8 so I can ping all those addresses:

OPS:507 root at dev-ops-test11.vega:mhoskins# ifconfig lo
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:32 errors:0 dropped:0 overruns:0 frame:0
          TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8148 (7.9 KiB)  TX bytes:8148 (7.9 KiB)

OPS:508 root at dev-ops-test11.vega:mhoskins# ping 127.0.0.2
PING 127.0.0.2 (127.0.0.2) 56(84) bytes of data.
64 bytes from 127.0.0.2: icmp_seq=1 ttl=64 time=0.012 ms

--- 127.0.0.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.012/0.012/0.012/0.000 ms

OPS:509 root at dev-ops-test11.vega:mhoskins# ping 127.0.0.3
PING 127.0.0.3 (127.0.0.3) 56(84) bytes of data.
64 bytes from 127.0.0.3: icmp_seq=1 ttl=64 time=0.011 ms

--- 127.0.0.3 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.011/0.011/0.011/0.000 ms

However, I can't bind daemons to 127.0.0.2, etc. until I configure lo:0,
etc. aliases for those addresses!  If your ifconfig output doesn't show the
IP you want to listen-on, it won't work.  This is how it's been as long as
I've been alive.

If this is hard to believe, try adding a 10.0.0.2 (or whatever) loopback
alias with a netmask of 255.255.255.255 (the correct netmask for aliases)
and see how BIND behaves.

-- 
By nature, men are nearly alike;
by practice, they get to be wide apart.
        -- Confucius




More information about the bind-users mailing list