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 
 show key ["pattern"]          : show values w/key
 add key ["temporary"]         : add key w/current dict
 get key                    : get dict w/key
 set key                    : set key w/current dict
 remove key                 

 notify key                 : notify key in data store

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

 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                    

Command line interface to the data maintained by configd(8).
--prefs
 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 reachability of 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 dialup connection not currently active but could handle network traffic for the target system.
Connection Automatic a connection must first be established.
Traffic directed name/address,/code> will initiate the connection.
Local Address  
Directly Reachable Addresss via one of the interfaces on the system, a gateway will not be used.
Example:
  [0x7fff7bc0a440]> {name=sligiga}
Reachable

 1: start [0x7fff7bc0a440]> {name=sligiga} 
 2: on runloop [0x7fff7bc0a440]> {name=sligiga (DNS query active), flags=0x00000002, if_index=4}
Reachable 
*** 20:28:09.875
3: callback w/flags=0x00020002 (info="by name")
    [0x7fff7bc0a440]> {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")
    [0x7fff7bc0a440]> {name=sligiga (DNS query active), flags=0x00000000, if_index=4}
Not Reachable 
*** 20:29:20.194 
 5: callback w/flags=0x00000000 (info="by name")
    [0x7fff7bc0a440]> {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")
    [0x7fff7bc0a440]> {name=sligiga (DNS query active), flags=0x00000002, if_index=4}
Reachable 
*** 20:29:26.147 
 7: callback w/flags=0x00020002 (info="by name")
    [0x7fff7bc0a440]> {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 data maintained by configd return zero.
If not present, wait for timeout for data to be associated with or a notification to be posted using the key.
Non-zero 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 -uuid0- 
  subKey [9]=Setup:/Network/Service -uuid0- /IPv4
  subKey [10]=Setup:/Network/Service -uuid0- /IPv6
  subKey [11]=Setup:/Network/Service -uuid0- /Interface
  subKey [12]=Setup:/Network/Service -uuid0- /Proxies

  subKey [13]=Setup:/Network/Service -uuid1- 
  subKey [14]=Setup:/Network/Service -uuid1- /IPv4
  subKey [15]=Setup:/Network/Service -uuid1- /IPv6
  subKey [16]=Setup:/Network/Service -uuid1- /Interface
  subKey [17]=Setup:/Network/Service -uuid1- /Modem
  subKey [18]=Setup:/Network/Service -uuid1- /PPP
  subKey [19]=Setup:/Network/Service -uuid1- /Proxies

  subKey [20]=Setup:/Network/Service -uuid2- 
  subKey [21]=Setup:/Network/Service -uuid2- /IPv4
  subKey [22]=Setup:/Network/Service -uuid2- /IPv6
  subKey [23]=Setup:/Network/Service -uuid2- /Interface
  subKey [24]=Setup:/Network/Service -uuid2- /Proxies

  subKey [25]=Setup:/Network/Service -uuid3- 
  subKey [26]=Setup:/Network/Service -uuid3- /IPv4
  subKey [27]=Setup:/Network/Service -uuid3- /IPv6
  subKey [28]=Setup:/Network/Service -uuid3- /Interface
  subKey [29]=Setup:/Network/Service -uuid3- /Proxies

  subKey [30]=Setup:/Network/Service -uuid4- 
  subKey [31]=Setup:/Network/Service -uuid4- /IPv4
  subKey [32]=Setup:/Network/Service -uuid4- /IPv6
  subKey [33]=Setup:/Network/Service -uuid4- /Interface
  subKey [34]=Setup:/Network/Service -uuid4- /Proxies
  subKey [35]=Setup:/Network/Service -uuid4- /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 -uuida- /DHCP subKey [63]=State:/Network/Service -uuids- /DNS subKey [64]=State:/Network/Service -uuida- /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), dig