Add "Serch Domain" in Network Preferences with Terminal command

Hi!
I'd like to add a Search Domain in the Network setting using a Terminal command. With this I can use ARD3 to end the command to several machines at once wihtout having to go to each machine and do it in the GUI.
I know you can write to preference files with the Terminal, but I don't know what to type.
Please help.
Thanks in advance!

Hey Camelot,
   You're getting a lot of mileage out of that new command. Kudos for finding it.
Hi Martin,
   Naturally Camelot's command is the most elegant solution. The Systems Preferences settings for the network are stored in the /Library/Preferences/SystemConfiguration/preferences.plist property list file but I think that's only consulted at boot. The search path is too deep to be comfortably manipulated by the "defaults" command but we could probably do it with sed if that would help.
   When the network comes up, the above information is combined with data from DHCP to create the /var/run/resolv.conf file, which is linked to by the classic /etc/resolv.conf file. That has a "search" field that holds the search domains in a whitespace delimited list. I don't know how often that's consulted but that's the final source of the information.
Gary
~~~~
   Life would be so much easier if we could just look at the
   source code.
      -- Dave Olson

Similar Messages

  • I need help, How could I add Aliases to Local Administrator account via terminal commands???

    I need help, How could I add Aliases to Local Administrator account via terminal commands???
    I want to use commands to add alias for existing administrator account remotly by using ARD.
    Thanks.

    Hi,
    a Windows Domain Controller does not have any local user or groups. So you might add the user to the admin group at Domain level.
    B RGDS,
    Gregor
    Edited by: Gregor Gasper on Jan 9, 2009 1:44 PM

  • Can't open profile manager for mac with terminal command

    i have tried to open profile manager version 0.3.0 11/4/11 3:31 PM
    with every command that an extensive search has revealed. each attempt yields a "no such file or directory response"; e.g.,Last login: Tue Nov 29 00:26:23 on ttys000
    Welcome to Darwin!
    r-c-wolins-computer:~ rcwolin$ /Functions/firefox.app/Contents/MacOS/firefox -profilemanager
    -bash: /Functions/firefox.app/Contents/MacOS/firefox: No such file or directory
    r-c-wolins-computer:~ rcwolin$. i'm using a macbook 3,1 with os 10.6.8 and ff 4.0.1. what am i doing wrong and how can i rectify it?
    thanks for your help. this is making me crazy.

    yes i did. it is in the applications folder. however, the default path when i open a shell won’t get me there and i don’t know how to change it. it should be /don’t forget to smash the state [my computer’s name]/macintosh hd/applications/browsers/firefox.app [or something to that effect].
    also, when i drag profilemanager .app into terminal shell i get
    r-c-wolins-computer:~ rcwolin$ /Applications/ProfileManager.app
    -bash: /Applications/ProfileManager.app: is a directory
    does this mean that profilemanager.app is a directory? if it is, how do i access it?
    further, if /Firefox.app/Contents/MacOS/firefox-bin -profilemanager is supposed to be where the command indicates, it isn’t. how do i get it there?
    thanks for your help. you bailed me out before when i was perplexed about .sqlite files. i appreciate it.

  • Done Something Dumb, Please Help With Terminal Command

    OK, So I couldn't figure out why I was no longer getting Growl notifications with mail.app and GrowlMail after I upgraded to 10.5. Turns out it has something to do with the bundle version it is running. I ran the following 2 terminal commands found here : http://www.davidroessli.com/logs/2007/01/gettinggrowlmail_towork/
    they were:
    defaults write com.apple.mail EnableBundles 1
    defaults write com.apple.mail BundleCompatibilityVersion 2
    Once I launched mail.app again the application told me that it had shut off support for the Plaxo plugin that I use. Now neither Growl nor the Plaxo plugin work. Long story short, can someone explain to me how to put mail.app back the way it was before I foolishly ran terminal commands? Thanks in advance

    Email the author. Growl isn't supported by Apple.
    You are aware that the article was written quite a while before 10.5.2 was released? It's not a good idea to implement modifications that are not tested on the current version of OS X without checking first with the author of such modifications. It's especially not a good idea to use the "defaults write" command without knowing how to undo the change.
    The first command is undone by substituting 0 for 1. Change the second one from 2 to 3.

  • Open With menu won't clean up with Terminal command

    After upgrading to 10.6 last month I can't clean up my open with menu. I ran the following in Terminal and it did nothing to clean up the duplicates:
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchS ervices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    I used to run the following in Tiger and it never failed to clean up the duplicates:
    /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Support/lsregister -kill -r -domain local -domain system -domain user
    Must I delete “com.apple.LaunchServices” file located in Home/Library/Preferences
    OR
    Remove launch services preference files, "com.apple.LaunchServices.plist" and "com.apple.LaunchServices.QuarantineEvents" in /username/Library/Preferences/ folder and then run the commands to clear and rebuild the launch services?

    Thanks Andy. Running the following in Terminal cleaned up your problem with the Open With menus?
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -r -domain local -domain system -domain user
    In December cnet.com wrote about running that command: "It gave only temporary relief to people dealing with sluggish Save and Save as menus." Using Onyx to clear caches and reset launch services was suggested instead. In October and March cnet.com wrote about rebuilding launch services to stop Finder caused crashes in Snow Leopard by trashing the launchservices preference files from user/library and then running the following in Terminal (custom file associations will revert back to default):
    /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchSe rvices.framework/Versions/A/Support/lsregister -kill -seed -rfv -all user, system, local
    When I was still running Tiger last year and had a Launch Services problem caused by crashes in the Finder due to misplaced folder aliases, BD Aqua in this forum linked me to The X Lab @
    http://www.thexlab.com/faqs/resetlaunchservices.html#Anchor-Reset-47857
    where I learned all I needed to do to straighten things out was delete the following cache files from HD/Library/Caches:
    com.apple.LaunchServices-0140.csstore
    com.apple.LaunchServices-014nnn.csstore
    The information about resetting Launch Services at the X Lab stops with Leopard. There are no cache files in Snow Leopard like those from Tiger above and their equivalents in Leopard.

  • How do you add start parameters in opmn.xml with a command?

    I'm trying to make a shell script to install an OC4J automatically. What I need to do now is adding start-parameters to the opmn.xml. Obviously, I don't want to go into the file itself and manually add the text. Is there a command to set them?? Or is there any other way around this?
    I.e., I want to add -Duser.country=SE and -Duser.language=sv as below:
    <process-type id="OC4J_I413" module-id="OC4J" status="enabled">
    <module-data>
    <category id="start-parameters">
    <data id="java-options" value="-Doc4j.formauth.redirect=true
    -Dhttp.session.debug=true
    -Duser.country=SE
    -Duser.language=sv"/>
    </category>
    </module-data>
    </process-type>
    Thanks a lot!
    Kerstin

    Hi again,
    Solved the issue simply by editing the xml file with sed:
    VAR1='OC4J_I413\/config\/java2\.policy -Djava\.awt\.headless\=true -Dhttp\.webdir\.enable\=false -XX\:MaxPermSize\=128M -Xms512M -Xmx1024M -XX\:AppendRatio\=3\"\/\>'
    VAR2='OC4J_I413\/config\/java2\.policy -Djava\.awt\.headless\=true -Dhttp\.webdir\.enable\=false -XX\:MaxPermSize\=256M -Xms512M -Xmx1024M -XX\:AppendRatio\=3 -Duser\.country\=SE -Duser\.language\=sv\"\/\>'
    sed "s/$VAR1/$VAR2/" opmn.xml > Newopmn.xml; cp Newopmn.xml opmn.xml
    This is a text string that contains start parameters and it can be found here:
    <category id="start-parameters">
    <data id="java-options" value="-server -Djava.security.policy=$ORACLE_HOME/j2ee/OC4J_I413/config/java2.policy -Djava.awt.headless=true -Dhttp.webdir.enable=false -XX:MaxPermSize=128M -Xms512M -Xmx1024M -XX:AppendRatio=3"/>
    //Kerstin

  • Inadvertently deleted user folder with terminal command - HELP!

    Hi
    I was using terminal to delete my hosts file using the following command:
    sudo rm -rf /Users/xxx/.ssh/known_hosts
    Unfortunalely, I misplaced a space after the username, and deleted most of my user files. I thought something weird was happening when all the desktop icons dissappeared, and restarted immediately.
    Now I am missing all of my docs, and desktop files. Some things are preserved, like itunes library and iPhoto library. My backup is over 6 months old.
    I took out the hdd, put in an external enclosure, and hooked it up to another SL machine. I ran stellar phoenix overnight, but the recovered files all seem to be weird system files, mostly .plist files, nothing recent.
    Any suggestions?
    Thanks

    ro-76 wrote:
    Thanks for the reply.
    My main backup is over 6 months old.
    then I suggest you start backing up regularly. there is no excuse not to do it.
    I use dropbox to backup the stuff I'm working on at the moment, but not the older stuff.
    I found it strange that I could not recover anything with Stellar Phoenix. Is there something special about deleting using terminal? Does it completely erase the file?
    not unless you use srm which you didn't. but NOT data recover software as you tried is perfect nor can it be expected to be. when you delete a file either from finder or from terminal it's unlinked from the directory but the actual space it's stored on the drive is not immediately overwritten by new data. that's what makes data recovery even possible. however, from that moment on it's treated as free space and can be overwritten at any instant. as soon as this happens data recovery becomes impossible. the only true way to protect your data is to *back up*.
    I'll try Data Rescue 3.

  • How to darken the desktop with terminal commands?

    how knows a trick?
    i need to start several videos with mplayer form a bath file.
    between the videos the screen has to be black.
    so how can i make the whole desktop black with commands from terminal?
    i am grateful for any idea.
    hans

    i need to start several videos with mplayer form a bath file.
    between the videos the screen has to be black.
    I'm not familiar with mplayer, but doesn't it have a kind of "playlist"?
    VLC has a playlist which enables you to play a sequence of movies without leaving the fullscreen mode.

  • Network access with Tux Commander - can anyone help??

    Hi,
    I'm using Tux Commander as my file manager (latest release).  I use it with Fluxbox over Arch.  We have a small Lan with 2 MS win boxes and two Linux boxes.  If I use XFFM I can see and get at all the other machines through the SMB Network option.
    One of the TuxC options is Network and when I select that it then has an option for 'Open Connection'. Next you get to define each 'connection'.  I enter the following values into the following fields;
    Name >>  OURSERVER
    URI    >>   smb://administrator.***@OURSERVER
    Server[;port]:   >>   OURSERVER:
    Username:    >>   administrator
    password      >>   ***
    When I select 'connect'  it replies with;
    'Couldn't open the URI specified. Please check the consistency of the resource identifier and the access permission.'
    Does anyone have a clue?  I have scoured the net for detailed docs on Tux Commander and found none although it is a good file manager and I'd really like to be able to use it.
    Thanks,
    Jim

    well, if it's standard URI format, it should be:
    protocol://username:password@address
    protocol = smb
    username = administrator
    password = ***
    address = OURSERVER
    smb://administrator:***@OURSERVER (you had a period)
    Also, try it w/o the password and it should ask for it.
    This is all, of course, if TuxCommand supports the smb protocol...
    You may also need a way to resolve the server names if TuxCommander doesn't use NetBios to resolve them

  • Clear all dock items - with Terminal command

    Hi!
    I need an command for clearing all dock items. I have good command line skill but couldnt find a way to just clear it all. Somebody have?
    Thanks.
    (I know Server could help me do that but i belive server takes to much time to fully apply than just using small tools for wath my need is.)
    Hmm. Found one way :-). Manually edit the prefs file on the user login.

    Thanks for the replies.
    @ mende1 - I did hold cmd-R to reach the recovery partition. How do I now leave safe mode (if it is stuck in that) and boot normally?
    @ Thomas - DU seems to be successful in repairing the disk. It doesn't report any errors - just says what it is "checking", "updating" and "adjusting" (not a very long list at all) - but it concludes with partition map appears to be OK.
    My other Mac has all my files so I don't mind reinstalling on this one, except for the fact that I would have to reinstall all the applications and I don't have them with me where I am at the moment.
    If I choose to reinstall when booted with cmd-r will it re-download or install from a local copy? Re-downloading will take forever because I only have mobile (3G) broadband here.
    Do I have any other options?
    Thanks for helping.
    /p

  • Default DNS grayed out in Network Preferences

    In my Network Preferences, my router address/gateeway is listed twice as a default DNS. Maybe once from Tiger and once more from Leopard?
    This is probably a Verizon thing
    The problem is that they are grayed out and cannot be removed by normal means AFAIK.
    My console reports that the same DNS is repeated - a minor but annoying item.
    It there any reason for me not to simply comment out one of these pesky DNS in the
    /etc/resolv.conf
    file?
    I have already added two more OpenDNS in the Network Preferences with no problem, and they properly show up in the resolv.conf file as 1 and 2, with the default DNS being 3 and 4.
    Why are these default DNS grayed out in Network Preferences?
    How did they get there in the first place?
    Is there a proper place to remove them or at least un-gray them?
    Will commenting out or removing one of the dupes in the resolv.conf file hose anything?

    xnav wrote:
    Have you got something like 'local DNS caching' turned on in the Verizon? Commenting out of .conf may not stick, I think DHCP will just rebuild it.
    I think it's the Verizon router offering the router IP as a fake DNS, which then passes onto the real Verizon DNS down the pipe. Verizon has one of those DNS that trap 404's and offer assistance.
    I think that Leopard looks for 2 DNS minimum and therefore takes the Verizon router number 2 times. It's the first time I have seen a router use its own IP as a DNS.
    When I switch to the Cable system, the duplicate fake DNS get replaced with the real cable DNS almost immediately, so you are right in that it is dynamic, and editing the conf file would do nothing.
    At least I now understand what's happening. It has to be that Leopard asks for 2 DNS or that Verizon router offers the same IP twice.
    I will have to look into the Verizon router a bit more to see if I can do something

  • Help with Terminal Please

    Here's the deal. My cousin was playing on my computer when I was at a friends and decided to mess with terminal. Now it won't work. Here is the site of the codes he was working with → http://www.usingmac.com/2009/4/27/twiddle-with-terminal-command-prompt I also made a screenshot of how my terminal changed → http://img29.imageshack.us/my.php?image=terminalshot.tif
    The problem now is I can't type anything in it. Any help is appreciated. Thanks.
    Sarah

    The simplest recover is to use TimeMachine to restore the system to just prior to the hacking.
    Also Apple recommends NEVER using your computer casually as an administrator.
    Letting other people play with your computer as a toy, when you are running an administrator account is begging for problems.
    If you don't have a backup, ask your cousin exactly what he did, and reverse it.

  • How do I add a USB interface back to my network preferences

    Help, I mistakenly deleted the usb interface from the list of available interfaces from my network preferences. How do I add it back?

    Hello,
    I found a website that you can download mail for. I dont know if you can trust the website, but this is just to let you know that it is out there. http://en.softonic.com/s/mail:mac
    Also, if you do not want to download that, you can alway have a safari tab open with you email. That also works.

  • Why can I not add a server to the DNS list in Network Preferences?

    I've run namebench to find faster DNS servers, but I can't add any DNS addresses to the DNS panel in Network Preferences.  Running Yosemite on a iMac.  I'm connected wifi to my Extreme. Thanks

    Are the System Preferences unlocked? You need admin access to edit these settings, click the lock if it is closed to block the preferences with the admin username & password.
    Is the DNS entry grey? That means it is provided by the router in a 'DHCP option'. You should still be able to specify others, click the 'Advanced' button, select the DNS tab & click + to add an entry.

  • I currently have a D-Link DI-604 broadband router with windows computers.  How can I add wifi to the network for use with ipad?  Can I use AirPort Express?

    I currently have a D-Link DI-604 broadband router with windows computers.  How can I add wifi to the network for use with ipad?  Can I use AirPort Express?

    Yes. You can directly connect an 802.11n AirPort Express Base Station (AXn) using an Ethernet cable. The AXn would then just need to be configured as a bridge to allow the D-Link to continue to provide both NAT & DHCP services for all network clients connected to either router.
    In this configuration, the AXn would broadcast a wireless network for your wireless network clients to connect to.

Maybe you are looking for

  • Steps for CO-PA data sources enhancement

    Hello Experts, I am planning to delete and re-create my CO-PA datasources to include a field from KEB0. What are the order of the steps to be followed. I know that I have to delete and recreate the data-source in KEB0. but when exactly do I have to f

  • What exact time is the ipad mini preorder begin?

    What exact time is the ipad mini preorder begin? Been waiting here and really want to know when it releases.....

  • ITunes match, Internet Access really needed??!!

    iTunes Match says it requires internet access, so what if you live in the city and take the train where there is no internet access, does that mean you can't listen to music?

  • Commit Waits in the database

    Dear Experts, *RDBMS version - 11.1.0.7 on AIX* I'm noticing a lot of "commit" waits in my 2 node RAC database. Most of them coming from Instance 1. I tried increasing redo log file size and it didn;t seem to fix the issue. Any comments? I'm seeing t

  • How to Inactivate changes made by Change Master

    Hi Guru's, We use Change Master (no system status & release approach in use). If a BOM is changed with CM & data manager wants the change to be inactive (Planned Orders/ process orders should not copy the data of this CM), what could be the solution.