Append search domains in Yosemite?

Discussion in 'OS X Yosemite (10.10)' started by djh816, Jul 10, 2014.

  1. djh816 macrumors newbie

    Joined:
    Jul 10, 2014
    #1
    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?
     
  2. djh816 thread starter macrumors newbie

    Joined:
    Jul 10, 2014
    #2
    Bump? I still haven't found a good way to do this :(
     
  3. The19th macrumors regular

    Joined:
    Jul 24, 2014
    Location:
    NorCal
    #3
    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:
     
  4. djh816 thread starter macrumors newbie

    Joined:
    Jul 10, 2014
    #4
    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
     
  5. The19th macrumors regular

    Joined:
    Jul 24, 2014
    Location:
    NorCal
    #5
    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.
     
  6. djh816 thread starter macrumors newbie

    Joined:
    Jul 10, 2014
    #6
    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
     
  7. joedj macrumors newbie

    Joined:
    Nov 5, 2014
    #7
  8. teknisten macrumors newbie

    Joined:
    Nov 18, 2014
    Location:
    Sweden
    #8
    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
     

Share This Page