I'm experimenting DNS server setup that reply different results based on source IP address. and the same time I need to dynamically change what interface external source ip should forward,

eth0    physical inteface
eth0:   virtual interface 1
eth0:1  virtual interface 2

I have bind9 install in my server with two views configured and both listening and 12 respectively.

In my setup only external facing interface is eth0 and all the clients request DNS through it. I need to forward those request to my virtual interface based on my clients source IP address and change it dynamically.

as an example

for scenario 1 if user query DNS through eth0 I need him to forward eth0: (

for scenario 2 same user ( I need to forward to eth0:1 (

I want to achieve that external user can get different results by using the same dns server in two different times.

| improve this question | | | | |

Have a look at iproute2. You can easily configure many route-tables and define network interface that handles the connection, including solution of your problem.

Here you are some useful examples:


| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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