Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

djh816

macrumors newbie
Original poster
Jul 10, 2014
5
0
I previously had been using the -AlwaysAppendSearchDomains option for mDNSResponder so that when I am on my company VPN I can ssh to hostnames like host1.subdomain and have it automatically resolve to host1.subdomain.example.com but this does not seem to work in Yosemite. Does anyone know how to replicate this behavior under Yosemite?
 

The19th

macrumors regular
Jul 24, 2014
205
43
NorCal
I don't know if this will work, but doing a general search on the internet yielded a similar question. It looks like mDNSResponder is disabled by default in Yosemite beta.

Please check out the following for some terminal commands:
http://apple.stackexchange.com/questions/140160/alternative-to-alwaysappendsearchdomains-on-yosemite

----------

Copied the link's instructions here to MacRumors Forums since questions about pre-release software are discouraged on that site and the information there may be removed.

From jwoolard at Ask Different:
I found the answer as I posted this:

To enable mDNSResponder, edit /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist and remove the lines
Code:
<key>Disabled</key>
<true/>

Then add -AlwaysAppendSearchDomains to the arguments list further down in the same file:

Code:
<string>_mdnsresponder</string>
<key>ProgramArguments</key>
<array>
    <string>/usr/sbin/mDNSResponder</string>
    <string>-AlwaysAppendSearchDomains</string>
</array>
Finally run

Code:
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
You can then verify mDNSResponder is running:

Code:
$ ps ax | grep -i dns | grep -v grep
10456   ??  Ss     0:00.44 /usr/sbin/mDNSResponder -AlwaysAppendSearchDomains
Subdomains of search domains can then be resolved.
 

djh816

macrumors newbie
Original poster
Jul 10, 2014
5
0
I don't know if this will work, but doing a general search on the internet yielded a similar question. It looks like mDNSResponder is disabled by default in Yosemite beta.

Thanks so much! That link worked great. I've streamlined the steps for anyone else who cares. Step 3 may error if mDNSResponder is not running (like a stock install) but you can safely ignore it.

Code:
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist Disabled false
Code:
sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist ProgramArguments -array-add "-AlwaysAppendSearchDomains"
Code:
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
Code:
sudo launchctl load /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
 

The19th

macrumors regular
Jul 24, 2014
205
43
NorCal
Thanks for cleaning it up into more manageable Terminal commands. I saw the Ask Different steps and told myself I wasn't going to go anywhere close to editing any of that mess! Glad it worked out for you and hopefully anyone else who uses appended search domains.
 

djh816

macrumors newbie
Original poster
Jul 10, 2014
5
0
Just FYI this no longer works on DP8 :( It appears the LaunchDaemon for mDNSResponder is completely gone on this release. Maybe I can do this somehow with discoveryutil but I haven't found a way yet
 

teknisten

macrumors newbie
Nov 18, 2014
1
0
Sweden
How to sort it out the simple way

Just found that actually the --AlwaysAppendSearchDomains is possible to add to com.apple.discoveryd.plist in same way as for mDNSResponer.

All this according to the help printed out by the executable for discoveryd:
/usr/libexec/discoveryd --help
Running with Apple Sandbox restrictions
usage: discoveryd [options]
--udsocket experimental|standard
--loglevel N|name
--logclass 0xX|class
--logto stderr|asl|aslstderr
--no-multicast : don't do multicast
--no-namechange : don't change the system names
--AlwaysAppendSearchDomains : Append Search Domains for multi-labeled PQDN as well !NOT RECOMMENDED!
--help
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.