Mimic DNS search suffix behavior on Windows?

PhillyPhoto
Valued Contributor

On Windows, you can set general DNS search suffixes (i.e. suba.domain.com, subb.domain.com, etc). Then there is also a "Connection-specific DNS suffix" setting the DNS server can share when the machine connects to the network (i.e. site1.suba.domain.com) depending on your office location. On Macs it seems to let you either take what the network gives you (which is limited to 1 entry) or use a longer list of manually specified options. Is there a way to mimic the Windows functionality of having a few general search domains which are set by script or config profile, but let the local network set a local search domain?

1 REPLY 1

cubandave
Contributor

Hey @PhillyPhoto 

 

the best option would be to modify the DHCP so when the client is in the network it uses those setting by default. Thankfully there are tools out there to build it in a way that works for macOS. 

Blog post about DHCP DNS suffix generation 

You could also make a separate erwogen location for on premise but my experience says that all that does is generate tickets and confusion. 

check `man networksetup`

 

some helpful starter info is available here

 

Network setup examples 

 

Hope this helps give you a head start.