Skip to main content
3 of 5
added 13 characters in body
klanomath
  • 67k
  • 10
  • 135
  • 204

Use hostnames from second network interface

MacBook Pro Mid-2015, macOS Catalina 10.15.2.

Summary

My Mac is connected to Wi-Fi and a wired LAN. Wi-Fi is the first in the Service Order in Network Preferences. There are some hostnames in the wired LAN that don't exist on the Wi-Fi.

How can I make it so that hostnames which don't exist on the Wi-Fi network, are "looked up" in the wired LAN network?


I am connected to a Wi-Fi network (which has an internet connection), and I am using a USB Ethernet adapter to connect to a second LAN (which doesn't allow internet access).

I changed my System Preferences > Network ordering so that the Wi-Fi takes precedence over the wired LAN. If I don't do this, then it seems I can't access the internet.

However, that means that the custom hostnames from the wired LAN aren't available:

$ ping customhostname
ping: cannot resolve customhostname: Unknown host

If I turn Wi-Fi off then it works:

$ ping customhostname
PING customhostname.mycompany.co.uk (192.168.100.200): 56 data bytes

Additionally, I can leave Wi-Fi turned on and still access that computer via the IP:

$ ping customhostname
ping: cannot resolve customhostname: Unknown host
$ ping 192.168.100.200
PING 192.168.100.200 (192.168.100.200): 56 data bytes

But how can I make it so that hostnames which aren't recognised (in this case, customhostname) by the Wi-Fi interface, are "looked up" in the wired LAN interface?

I don't want to have to memorise the IP address, and manually update my own records whenever it changes.

user150109