1

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   192.168.1.10
eth0:   virtual interface 1   192.168.1.11
eth0:1  virtual interface 2   192.168.1.12

I have bind9 install in my server with two views configured and both listening 192.168.1.11 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 192.168.1.40 query DNS through eth0 I need him to forward eth0: (192.168.1.11)

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

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

2

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:

References:

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.