Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Going from manual to DHCP-supplied DNS settings



On Feb 12, 2007, at 7:01 AM, Gregor Alessi wrote:

Hi Chris

If you enter /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup without arguments you get the list with the options.

Normally I would do this:

networksetup -setdnsservers "Built-in Ethernet" a.b.c.d

to set a manual IP, but if I want to use DHCP then what I want is to /clear/ the address listed. But, if I send either no IP addresses, a pair of single quotes or a pair of double quotes, networksetup complains. Does anyone know how to do what I'm referring to? To accomplish the functionality I want through the OS X GUI, you just launch Network settings from System Preferences and, so long as you're using DHCP, clear whatever manual IP addresses are defined for DNS servers. OS X knows to automagically use the DHCP-supplied ones if you do that.

I think the following is what you are looking for:

Usage: networksetup -setdhcp <networkservice> [clientid]
        Set the <networkservice> TCP/IP configuration to DHCP. You can set the
        DHCP client id to the optional [clientid]. Specify "Empty" for [clientid]
        to clear the DHCP client id.

Usage: networksetup -setdnsservers <networkservice> <dns1> [dns2] [...]
        Set the <networkservice> DNS servers to <dns1> [dns2] [...]. Any number of dns servers can be
        specified. Specify "Empty" for <dns1> to clear all DSN entries.

Thanks Gregor! The "empty" command is exactly what I needed.


Chris


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Remote-desktop mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/remote-desktop/email@hidden

This email sent to email@hidden

References: 
 >Going from manual to DHCP-supplied DNS settings (From: Chris Waltham <email@hidden>)
 >Re: Going from manual to DHCP-supplied DNS settings (From: Gregor Alessi <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.