Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Bind bind to secondary IP

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
5 posts • Page 1 of 1
Author
Message
musv
Advocate
Advocate
User avatar
Posts: 3380
Joined: Sun Dec 01, 2002 4:13 pm
Location: de

Bind bind to secondary IP

  • Quote

Post by musv » Fri Aug 19, 2022 11:04 am

Hi there,

I'm running some bind servers. To be able to move the Bind application to a different server, we're using service IPs.

E.g.
Master server:
Server-IP: 172.16.0.1/16
Service-IP: 172.16.1.1/16 (=Secondary IP + Listen address in named.conf)

Slave server:
Server-IP: 172.16.0.2/16
Service-IP: 172.16.1.2/16 (=Secondary IP + Listen address in named.conf)

The clients use 172.16.1.1 and 172.16.1.2 in their resolv.conf.

When I update a zone file on the master zone the slave will be notified. But the notification will be send on 172.16.0.1 and not on 172.16.1.1. On the slave server the problem is similar. The zone transfer will be requested from 172.16.0.2 and not from 172.16.1.1.

So I have to specify in the zone definition of the Master: allow-transfer { 172.16.1.1; 172.16.0.1; }; and on the Slave: allow-notify { 172.16.0.1; };

How can I bind the Named server to use explicitly the secondary IP for inbound (listen) and outbound (sending) traffic?
Top
mvaterlaus
Apprentice
Apprentice
Posts: 242
Joined: Fri Oct 01, 2010 3:29 pm
Location: Switzerland

  • Quote

Post by mvaterlaus » Fri Aug 19, 2022 2:10 pm

Hi,
i think you can add the following to your named config:

Code: Select all

...
options {
        listen-on port 53 { 127.0.0.1; 172.16.1.1; };
...
This will tell Bind to listen on localhost and the specified IP. Also it will no longer answer queries on the interface with IP 172.16.0.1.
Top
musv
Advocate
Advocate
User avatar
Posts: 3380
Joined: Sun Dec 01, 2002 4:13 pm
Location: de

  • Quote

Post by musv » Tue Aug 30, 2022 11:14 am

mvaterlaus wrote:Also it will no longer answer queries on the interface with IP 172.16.0.1.
What you have written is already configured.

The problem are not the answers of the DNS queries by any clients. The problem is the zone update notification sent by the master to the slaves. This is done via the primary IP.

And also the zone update request on the slaves to the master are sent on the primary IP.
Top
szatox
Advocate
Advocate
Posts: 3858
Joined: Tue Aug 27, 2013 12:35 pm

  • Quote

Post by szatox » Tue Aug 30, 2022 11:49 am

It's been a while since I touched bind for the last time, but you should have defined a slave server in master's configuration.
There is also-notify option too.
So, if you define master and slave relationship using secondary IPs, routing table should take care of the rest. Like in: the notification is for 172.16.1.2 which is connected by a specific route, therefore I should use 172.16.1.1 as the source address instead of default.

Also:

Code: Select all

Server-IP: 172.16.0.1/16
Service-IP: 172.16.1.1/16
This is wrong. Both addresses are in the same network. While such setup can be used in some scenarios, it won't work for you. Make at least one of those masks more specific.
Top
mvaterlaus
Apprentice
Apprentice
Posts: 242
Joined: Fri Oct 01, 2010 3:29 pm
Location: Switzerland

  • Quote

Post by mvaterlaus » Thu Sep 01, 2022 2:31 pm

Hmm,
I never noticed this, when running a BIND server with two Interfaces. I find this behavior very strange. But according to this link [1] you can use the following directives in your config:

Code: Select all

options {
    ...
    transfer-source 172.16.1.1;
    use-alt-transfer-source yes;
    ...
}

[1] https://www.cyberciti.biz/tips/bind-nam ... dress.html
Top
Post Reply

5 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic