1

I have a LAN with a Linux server running BIND for addressing of local computers. When a workstation is connected to the local network (where there is no Internet access), I can successfully address devices using hostnames without any problems:

$ host server1.local $ server1.local has address 192.168.2.2 $ host 192.168.2.2 $ 2.2.168.192.in-addr.arpa domain name pointer server1.local. 

When that same workstation enables WiFi (or any secondary interface) and connects to the greater Internet, the machine can no longer address local devices by hostname. Presumably this is because it is using the wrong network interface's DNS server to address my devices.

My BIND configuration is as follows:

$ORIGIN local. $TTL 604800 @ IN SOA server1 admin ( 2008080101 ;serial 04800 ;refresh 86400 ;retry 2419200 ;expire 604800 ;negative cache TTL ) @ IN NS server1 @ IN A 192.168.2.2 server1 IN A 192.168.2.2 workstation1 IN A 192.168.2.44 workstation2 IN A 192.168.2.45 

and the reverse DNS:

$ORIGIN 2.168.192.in-addr.arpa. $TTL 604800 @ IN SOA server1.local. admin.local. ( 2008080101 ;serial 604800 ;refresh 86400 ;retry 2419200 ;expire 604800 ;negative cache TTL ) NS server1.local. 2 IN PTR server1.local. 44 IN PTR workstation1.local. 45 IN PTR workstation2.local. 

How can I force clients to look at the correct network interface to find hosts in the ".local" namespace? Is it possible to do this from the BIND-configuration end, since I may not have complete control over the individual clients?

2
  • 2
    This sounds like it will be a matter of configuring the resolver library on the client machines. What OS are they running? /etc/resolv.conf (which quite possibly is different in the working and non-working state) from the clients is probably relevant. Commented Jun 24, 2014 at 20:33
  • Clients are a mixture of Windows and OS X, though only the Mac seems to have this issue. Windows resolves appropriately through both interfaces. Commented Jun 24, 2014 at 20:39

2 Answers 2

1

Certain versions of OS X assign preferences to DNS servers. This may cause your internal DNS server to be pushed down the preference order.

Try running this command to find out which server is being used:

scutil --dns | grep nameserver\[[0-9]*\] 

Sources:

2
  • Good info, but /etc/resolv.conf doesn't include the DNS servers from the LAN-connection (at all) as long as I am connected to Wi-Fi. Disconnecting from Wi-Fi immediately populates /etc/resolve.conf with the LAN DNS servers appropriately. Commented Jun 24, 2014 at 21:25
  • Edited. Perhaps the scutil command may help. Good luck! Commented Jun 24, 2014 at 21:28
0

Check your /etc/resolv.conf (OSX) after connecting to another network and make sure that it contains search .local. You can also try to have entries inside of hosts file (if that helps.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.