I'm working in Ubuntu 12.04 and I'm trying to set up a server with two network interfaces. One interface (eth0) uses dhcp and the other one (eth1) has a static ip. The problem is that if both interfaces are up, I cannot resolve names that are in the eth1-network. If I put down eth0, than it works fine.
Here is my /etc/network/interfaces:
I have comment out broadcast and gateway, otherwise eth1 won't even come up. After that configuration, my /etc/resolv.conf looks like this:
iface lo inet loopback
auto eth0 eth1
iface eth0 inet dhcp
iface eth1 inet static
# broadcast 192.168.0.255
# gateway 192.168.0.1
# dns-* options are implemented by the resolvconf package, if installed
So the first two addresses are provided via dhcp and the last one is the one that I provided in my /etc/network/interfaces file. Now lets say I have an host called "ihost12" with the ip address 192.168.0.12. I can connect to the ip address via ssh, no problem. But if I try to connect to it via name, or if I try to resolve the hostname with the "host" command, it won't find it.
But if I take down eth0, my /etc/resolv.conf changes to this:
and "ihost12" can also be resolved. So I was wondering, does the order in which the nameservers are defined in resolv.conf matter? And what can I check or try to solve this problem?