Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is my setup:

$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet 10.0.2.0/24 scope global lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

'lo' is magical in the sense that that 10.0.2.0/24 line actually creates ~250 bindable addresses. Most daemons bind to these without trouble. However, this does not work in my BIND9-config:

listen-on port 53 { 10.0.2.15; };

(I've tried without "port 53" too). The problem is that for BIND, listen-on is like a "binding whitelist", that it matches to all IPs it can find on all interfaces. In this case, it does not find 10.0.2.15 on any interfaces, so it does not bind.

Can anyone recommend a workaround? I should point out that this is a testing setup on which I am moving things around all the time so I would prefer a solution that does not involve too many moving parts.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

After a bit of testing... Bind doesn't appear to work the way you have observed other daemons working. I have noted 2 workarounds the first is add an additional address to lo to allow bind to bind to it

ip addr add 10.0.2.15/32 dev lo

The second is to change the address bind listens on to 10.0.2.0

share|improve this answer
    
I had found both of these too. Neither solve my problem, but given that I'm ready to accept that there is no answer, I'll accept this one :) –  Habbie Feb 24 '12 at 13:53
add comment

What you can do as a workaround for testing is to create a virtual interface lo:1 and assign the address 10.0.2.15 to it and bring it up

share|improve this answer
    
Yes - i know that this works. But it's not what I want :) –  Habbie Feb 24 '12 at 9:08
add comment

I don't think you can do that. The fact that the loopback interface responds on every ip on the configured subnet (i.e. ping 10.0.2.15 works as expected), doesn't mean every IP is bindable.

Try binding to, for example, 127.0.0.2 and see if it works.

I think the only solution is doing as @m0ntassar said.

share|improve this answer
    
the IPs are bindable just fine - every other daemon I've tried has absolutely no trouble with binding. –  Habbie Feb 24 '12 at 9:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.