How to setup nameserver for each network interface ?

Hello,

I have a machine installed Opensuse 12.2 64b that has 2 network interfaces eth0 and eth1.
Eth0 connect to subnetwork 178.17.0.1/24 with nameserver is 178.17.0.32, domain: company.com
Eth1 connect to subnetwork 192.168.0.1/16 with nameserver is 192.168.1.10 , domain: home.com

I used network setting in Yast and configure 2 interface that have IP respectively 178.17.0.46 ,192.168.0.46

DNS configuration, i chose use default policy and filled 2 nameservers and their domains in domain search.

For the routing table :
Des Gateway Genmask Device
178.17.0.0 178.17.0.46 255.255.255.0 Eth0
192.168.0.0 192.168.0.46 255.255.0.0 Eth1

I can ping the hosts in domain company.com, for ex: ping test1.company.com,
but i cannot ping the host in domain home.com (ping from those hosts to linux machine , it works). Although i added Opensuse machine addres in 2 DNS server in each domain.

It always use 178.17.0.32 to resolve host name in 2 cases. so how can i set up name server for each interface ?

On 2012-12-07 14:46, sieutruc wrote:
>
> Hello,
>
> I have a machine installed Opensuse 12.2 64b that has 2 network
> interfaces eth0 and eth1.
> Eth0 connect to subnetwork 178.17.0.1/24 with nameserver is
> 178.17.0.32, domain: company.com
> Eth1 connect to subnetwork 192.168.0.1/16 with nameserver is
> 192.168.1.10 , domain: home.com

The setup is wrong. If you ask for the IP of somewhere.home.com to the
company.com DNS it should resolve.

As this can not be done, you probably need to setup a general purpose
DNS server that answers to any query, not only those of their company.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

As Carlos suggests, you should configure both DNS zones on one DNS server(or see below about forwarding). An alternative if you only need to configure a very few Hosts is to enter in your Hosts file.

  • You should still verify IP networking to your home.com. Server.network is working properly, ping <both> directions using IP address.
  • I guess you know you’re using default Class C subnet mask for your Class B network (OK but ?) and default Class B subnet mask for your Class C network (necessary how you’ve assigned IP addresses)?

I’ve made your configuration (different DNS servers configured on different interfaces) work on a a windows box although even there it’s not advisable. On that box (internal and external interfaces) the recommended configuration was setting up an internal DNS server forwarding to an external DNS server. You could do something similar if you’re running DNS for each domain.

HTH,
TSU