Categories
MAC

Mac OSX DNS Search Domains Problem

I ran into an issue where I’d be forced to add my domain to the end of every server I SSH’ed into. Basically, DNS search domains stopped working. Here’s how to fix it.

Make a backup of your com.apple.mDNSResponder.plist file

$ sudo cp /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist ~/com.apple.mDNSResponder.plist.original

Edit your com.apple.mDNSResponder.plist file

$ sudo vi /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist

Add the below RED line.

<key>ProgramArguments</key>
<array>
 <string>/usr/sbin/mDNSResponder</string>
 <string>-launchd</string>
 <string>-AlwaysAppendSearchDomains</string>
</array>
maxosxdnssearchdomain

Reload your com.apple.mDNSResponder.plist file

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
Comments

By Tommy Elmesewdy

DevOps Engineer