I got a new MacBook Pro for my work office and have a network issue. On the MBP 13" I use the integrated Wi-Fi and an additional a Belkin USB Ethernet.

Now, with those two network interfaces I connect to two different networks:

a) Work network (Wi-Fi) b) Test network (Ethernet)

From both networks I get an IP via DHCP incl. DNS server address and search domain / suffix:

a) DNS Server a) Search domain .intern

b) DNS Server b) Search domain .home

Right now the Ethernet (b) is on top of the list:

enter image description here

If I now want to connect (ping) to a device in test network (b) it works:

ping ubuntu.work

But If I try to connect (ping) to a device in the company network (a) it doesn't work:

ping server.intern

I tried to switch the order of the devices (first Wi-Fi, second Ethernet) and then the issue swaps around (now .intern works but .work not anymore). For me it seems that macOS is sticky to the first (main?) network interface. I also tried to set the test network (Ethernet - when on top of the adapter list) to manual IP and to leave the DNS server / search domain empty, but even then the DNS from the second device (Wi-Fi) will not be used.

Does anyone have a solution for that? Can't be that I am the first one to come over that issue

  • Marked unclear! ping ubuntu.work with the search domain home doesn't make much sense in a Test network. Check your naming conventions! Or add the output of your ping commands!
    – klanomath
    Feb 23 '18 at 14:34
  • If ping ubuntu.work works in the test network then the fqdn of this host is either ubuntu.work or ubuntu.work.home! If the first is true the search domain home doesn't make sense. Please add proper fqdns of the hosts you try to ping!
    – klanomath
    Feb 23 '18 at 14:41
  • Close Voters: This question is entirely clear. He is attempting to to solve a multi-horizon DNS issue.
    – Allan
    Feb 24 '18 at 10:12

The problem that you are having is that you have two separate networks with their own DNS that don't know about each other - .intern and .home.

The problem comes in when you try to ping a host on a network (whichever is primary; let's assume .home) to another network (.intern). It will fail because the DNS for .home knows nothing about the .intern domain. It will assume the request needs to be forwarded to the ISP's DNS; and they don't know about that domain either.

You can fix this by enabling Unbound DNS resolver on your Mac so it can query itself. You will need to configure it to perform a split-horizon DNS service. Then, set your Mac to query only itself for DNS lookups.

Basically, your Mac becomes a DNS server that's aware of both networks and will respond to its DNS queries accordingly.

  • 1
    Thanks for your reply. How do I install this unbound resolver? I was wondering why DNS does not work at all if I set the first interface to manual IP without DNS / suffix. I thought that - since Mac OS then has only one DNS server left - everything would be resolved via the second interface. But it isn't....
    – Stefan
    Feb 23 '18 at 12:41
  • You also have to flush your DNS cache. Have a look at this question/answer for how to enable Unbound DNS on macOS. I had this exact problem but on FreeBSD...unfortunately, the installations are totally different, but once past that, the procedures for configuring the domains are the same
    – Allan
    Feb 23 '18 at 13:57

Take a look at this:


Basically, just create a file named 'intern' in /etc/resolver with the following contents:

domain intern
nameserver NAMESERVER

Just replace NAMESERVER with the ip address of your internal dns server.

Now your default nameserver will resolve requests as normal (the nameserver that's provided by the interface at the top of your network device list). But any requests to something like 'server.intern' will use the name resolution settings you provided in /etc/resolvers/intern

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .