scutil

generalized interface to "dynamic Store"
and
Network Services

scutil --prefs [preference-file]]

interactive access to the [raw] stored preferences.

When started without options, scutil prompts for commands (uses readline).

 list [pattern]                : list keys in data store
 show key ["pattern"]          : show values in data store w/key
 add key ["temporary"]         : add key in data store w/current dict
 get key                       : get dict from data store w/key
 set key                       : set key in data store w/current dict
 remove key                    : remove key from data store

 notify key                    : notify key in data store

 n.list ["pattern"]            : list notification keys  smackerPro as of 10/09/11:   "no notifier keys."
 n.add key ["pattern"]         : add 
 n.remove key ["pattern"]      : remove 
 n.changes                     : list changed keys
 n.watch                       : watch for changes
 n.cancel                      : cancel notification requests

 f.read file                   : process commands from file

 d.show                        : show dictionary contents
 d.init                        : initialize (empty) dictionary  smackerpro as of 10/09/11 <dictionary> { }
 d.add key [*#?] val [v2 ...]  : add information to dictionary
       (*=array, #=number, ?=boolean)
 d.remove key                  : remove key from dictionary

 quit                          : quit

Command line interface to the "dynamic store" data maintained by configd(8).
--prefs command line interface to the [raw] stored preference data.
Interaction with this data (using the SystemConfiguration.framework SCPreferences APIs) is handled with a set of commands read from standard input.
 list smackerPro sample
  path [0]=/NetworkServices
  path [1]=/Sets
  path [2]=/System
  path [3]=/VirtualNetworkInterfaces
First listed resolver(5) configuration is the "default" configuration.
Those containing a "domain" name will be used for queries matching the domain. Those without will be used as a "default" configuration in addition to the first listed.

Options

-r [-W] {
nodename |
address |

local-address remote-address }
Check the network reachability of the host , IP address, or a pair of local and remote IP addresses.
 > scutil -r hostname
flags = Reachable  (?)

 > scutil -r -W  noSuchHost
 0: direct     <SCNetworkReachability 0x7fdbfc406550 [0x7fffa110cd80]> {name = noSuchHost} flags = Reachable   (?)
 1: start      <SCNetworkReachability 0x7fdbfc406af0 [0x7fffa110cd80]> {name = noSuchHost} 
 2: on runloop <SCNetworkReachability 0x7fdbfc406af0 [0x7fffa110cd80]> {name = noSuchHost 
                                        (DNS query active), flags = 0x00000002, if_index = 4} flags = Reachable   (?)
*** 18:39:59.662 
 3: callback w/flags=0x00000000 (info="by name")
               <SCNetworkReachability 0x7fdbfc406af0 [0x7fffa110cd80]> {name = noSuchHost 
                                  (complete, no addresses), flags = 0x00000000, if_index = 4} flags = Not Reachable

-W (watch) Monitor reachability.

Not Reachable or not resolvable
Reachable  
Transient Connection e.g. PPP connection.
Connection Required this status would be returned for a dialup connection that was not currently active but could handle network traffic for the target system.
Connection Automatic a connection must first be established. Any traffic directed to the specified name/address will initiate the connection.
Local Address  
Directly Reachable Addresss via one of the interfaces on the system, a gateway will not be used.
Example:
   {name=sligiga}
Reachable

 1: start  {name=sligiga} 
 2: on runloop  {name=sligiga (DNS query active), flags=0x00000002, if_index=4}
Reachable 
*** 20:28:09.875
3: callback w/flags=0x00020002 (info="by name")
     {name=sligiga (DNS query active), flags=0x00020002, if_index=4}
Reachable, Directly Reachable Address
remove EN0 cable
*** 20:29:20.193 
 4: callback w/flags=0x00000000 (info="by name")
     {name=sligiga (DNS query active), flags=0x00000000, if_index=4}
Not Reachable 
*** 20:29:20.194 
 5: callback w/flags=0x00000000 (info="by name")
     {name=sligiga (complete, no addresses), flags=0x00000000, if_index=0}
Not Reachable 
*** 20:29:26.121
insert EN0 cable
 6: callback w/flags=0x00000002 (info="by name")
     {name=sligiga (DNS query active), flags=0x00000002, if_index=4}
Reachable 
*** 20:29:26.147 
 7: callback w/flags=0x00020002 (info="by name")
     {name=sligiga (complete, 192.168.1.4), flags=0x00020002, if_index=4}
Reachable, Directly Reachable Address


A non-zero exit status: errors are detected and an message to standard error.

-w key [-t timeout_seconds] If key exists in the "dynamic store" data maintained by configd return with a zero exit status.
If not present, wait for timeout for data to be associated with or a notification to be posted using the key.
A non-zero exit status is returned if key was not created/posted within the specified time.
Default: 15 seconds.
--get pref Display preferance on standard output.
scutil --get ComputerName # user-friendly name for the system.
scutil --get LocalHostName # local (Bonjour) host name.
scutil --get HostName # name associated with hostname and gethostname(3).
--set pref [newval] If newval is not specified it will be read from standard input.

ComputerName, LocalHostName and HostName
Requires super-user access.

--dnsreformatted
 > scutil --dns
DNS configuration 
resolver #1 search domain[0]: germans  nameserver[0]: 192.168.1.1  if_index: 4 (en0) 
                                                                   flags: Request A records  reach: Reachable, Directly Reachable Address 
resolver #2 domain: local                options: mdns  timeout: 5 flags: Request A records  reach: Not Reachable  order: 300000 
resolver #3 domain: 254.169.in-addr.arpa options: mdns  timeout: 5 flags: Request A records  reach: Not Reachable  order: 300200 
resolver #4 domain: 8.e.f.ip6.arpa       options: mdns  timeout: 5 flags: Request A records  reach: Not Reachable  order: 300400 
resolver #5 domain: 9.e.f.ip6.arpa       options: mdns  timeout: 5 flags: Request A records  reach: Not Reachable  order: 300600 
resolver #6 domain: a.e.f.ip6.arpa       options: mdns  timeout: 5 flags: Request A records  reach: Not Reachable  order: 300800 
resolver #7 domain: b.e.f.ip6.arpa       options: mdns  timeout: 5 flags: Request A records  reach: Not Reachable  order: 301000 

DNS configuration (for scoped queries) 
resolver #1 search domain[0]: germans  nameserver[0]: 192.168.1.1  if_index: 4 (en0) 
                                                                   flags: Request A records  reach: Reachable, Directly Reachable Address 
--nwi show network information
> scutil --nwi
Network information (generation 34743978609712)

IPv4 network interface information
     en0 : flags 0x5 (IPv4,DNS)
           reach 0x00000002 (Reachable)
           Signature Hash:  0x01d0c0fc4fb925973c2601cd3e2ff51b67a5fa7a
           generation 34743978609712 
   REACH : flags 0x00000002 (Reachable)

IPv6 network interface information
   No IPv6 states found

   REACH : flags 0x00000000 (Not Reachable)

Network interfaces: en0
--nc show VPN network configuration information.
list available network connection services in the current set
 > scutil --nc list
Available network connection services in the current set (*=enabled):
status service Indicate whether a given service is connected and extended status
show service Display configuration
statistics service bytes, packets, and errors
select service Make the given service active in the current set, allows it to be started
start service
      [--user uname]
      [--password [pw]]
      [--secret scrt]
stop
suspend
resume
ondemand -- --refresh Display VPN on-demand information
ondemand [-W] [hostname]
enablevpn service | vpn type [path] Pass a path to set ApplicationURL
trigger hostname [background] [port]
disablevpn service | vpn type
help shown here
--log IPMonitor [off|on] manage logging.
--error err# display a descriptive message for the given error code

list

> list   El Captian 3/3/16 smackerpro
  subKey [0]=Plugin:IPConfiguration
  subKey [1]=Plugin:InterfaceNamer
  subKey [2]=Plugin:KernelEventMonitor
  subKey [3]=Setup:
  subKey [4]=Setup:/
  subKey [5]=Setup:/Network/Global/IPv4
  subKey [6]=Setup:/Network/HostNames
  subKey [7]=Setup:/Network/Interface/en1/AirPort
  subKey [8]=Setup:/Network/Service/220EB5E8-F842-46FD-903C-CCE484814CC4
  subKey [9]=Setup:/Network/Service/220EB5E8-F842-46FD-903C-CCE484814CC4/IPv4
  subKey [10]=Setup:/Network/Service/220EB5E8-F842-46FD-903C-CCE484814CC4/IPv6
  subKey [11]=Setup:/Network/Service/220EB5E8-F842-46FD-903C-CCE484814CC4/Interface
  subKey [12]=Setup:/Network/Service/220EB5E8-F842-46FD-903C-CCE484814CC4/Proxies
  subKey [13]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311
  subKey [14]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311/IPv4
  subKey [15]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311/IPv6
  subKey [16]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311/Interface
  subKey [17]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311/Modem
  subKey [18]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311/PPP
  subKey [19]=Setup:/Network/Service/59F44D5D-FCB6-4D58-A153-202D7DCE9311/Proxies
  subKey [20]=Setup:/Network/Service/E4CC10FC-2900-49B6-B0E8-19890DD1B11C
  subKey [21]=Setup:/Network/Service/E4CC10FC-2900-49B6-B0E8-19890DD1B11C/IPv4
  subKey [22]=Setup:/Network/Service/E4CC10FC-2900-49B6-B0E8-19890DD1B11C/IPv6
  subKey [23]=Setup:/Network/Service/E4CC10FC-2900-49B6-B0E8-19890DD1B11C/Interface
  subKey [24]=Setup:/Network/Service/E4CC10FC-2900-49B6-B0E8-19890DD1B11C/Proxies
  subKey [25]=Setup:/Network/Service/F764A54F-4318-44B6-A086-9C2D0BC0EA99
  subKey [26]=Setup:/Network/Service/F764A54F-4318-44B6-A086-9C2D0BC0EA99/IPv4
  subKey [27]=Setup:/Network/Service/F764A54F-4318-44B6-A086-9C2D0BC0EA99/IPv6
  subKey [28]=Setup:/Network/Service/F764A54F-4318-44B6-A086-9C2D0BC0EA99/Interface
  subKey [29]=Setup:/Network/Service/F764A54F-4318-44B6-A086-9C2D0BC0EA99/Proxies
  subKey [30]=Setup:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733
  subKey [31]=Setup:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/IPv4
  subKey [32]=Setup:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/IPv6
  subKey [33]=Setup:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/Interface
  subKey [34]=Setup:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/Proxies
  subKey [35]=Setup:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/SMB
  subKey [36]=Setup:/System
  subKey [37]=State:/IOKit/LowBatteryWarning
  subKey [38]=State:/IOKit/Power/CPUPower
  subKey [39]=State:/IOKit/PowerAdapter
  subKey [40]=State:/IOKit/PowerManagement/CurrentSettings
  subKey [41]=State:/IOKit/PowerManagement/SystemLoad
  subKey [42]=State:/IOKit/PowerManagement/SystemLoad/Detailed
  subKey [43]=State:/Network/Global/DNS
  subKey [44]=State:/Network/Global/IPv4
  subKey [45]=State:/Network/Global/Proxies
  subKey [46]=State:/Network/Global/SMB
  subKey [47]=State:/Network/Interface
  subKey [48]=State:/Network/Interface/en0/IPv4
  subKey [49]=State:/Network/Interface/en0/IPv6
  subKey [50]=State:/Network/Interface/en0/Link
  subKey [51]=State:/Network/Interface/en0/LinkQuality
  subKey [52]=State:/Network/Interface/en1/Link
  subKey [53]=State:/Network/Interface/en1/LinkQuality
  subKey [54]=State:/Network/Interface/fw0/Link
  subKey [55]=State:/Network/Interface/lo0/IPv4
  subKey [56]=State:/Network/Interface/lo0/IPv6
  subKey [57]=State:/Network/Interface/lo0/LinkQuality
  subKey [58]=State:/Network/Interface/p2p0/Link
  subKey [59]=State:/Network/MulticastDNS
  subKey [60]=State:/Network/NetBIOS
  subKey [61]=State:/Network/PrivateDNS
  subKey [62]=State:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/DHCP
  subKey [63]=State:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/DNS
  subKey [64]=State:/Network/Service/F7E25547-4BDC-4D8C-96E4-160E9E8E8733/IPv4
  subKey [65]=State:/Network/mDNSResponder/DebugState
  subKey [66]=State:/Users/ConsoleUser
  subKey [67]=com.apple.CFNetwork.netcompat.HTTPPipelining:IPv4.Router=192.168.1.1;IPv4.RouterHardwareAddress=00:7f:28:cc:a9:f1
  subKey [68]=com.apple.CFNetwork.netcompat:com.apple.CFNetwork.netcompat.lastpurge
  subKey [69]=com.apple.DirectoryService.NotifyTypeStandard:DirectoryNodeAdded
  subKey [70]=com.apple.opendirectoryd.node:/Contacts
  subKey [71]=com.apple.opendirectoryd.node:/Search
  subKey [72]=com.apple.smb
See also configd(8)