20

I'm looking for the configuration file that keeps track of the Network Proxy settings in OS X. Is it stored in a .plist file?

Specifically I'd like to programmatically modify the "Bypass proxy settings for these Hosts & Domains" field.

matpie
  • 17,033
  • 9
  • 61
  • 82

3 Answers3

20

You can use the networksetup command to get and set the proxy bypasses. Excerpts from the man page:

networksetup
  [-getproxybypassdomains networkservice]
  [-setproxybypassdomains networkservice domain1 [domain2] [...]]


  -getproxybypassdomains networkservice
     Displays Bypass Domain Names for <networkservice>.

   -setproxybypassdomains networkservice domain1 [domain2] [...]
     Set the Bypass Domain Name Servers for <networkservice> to <domain1> [domain2] [...]. 

Any
number of Domain Name servers can be specified. Specify "Empty" for to clear all Domain Name entries.

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216
cjs
  • 339
  • 1
  • 9
  • 1
    For the uninformed, you can display a complete list of options with usage instructions by entering the command `networksetup` with no parameters. Also, to display a list of names of each available `` enter the command `networksetup -listallnetworkservices`. – gfullam May 10 '16 at 14:40
10

You can change your MAC OS proxy using below command:-

networksetup -setwebproxy "Your network service name(Airport,Ethernet etc..)" host port

example:-

networksetup -setwebproxy "Ethernet Adaptor (en0)" 122.176.70.186 80

Simply run this command on the terminal.

JonoCoetzee
  • 969
  • 2
  • 15
  • 30
Anand Meena
  • 101
  • 1
  • 2
7

The settings are stored in /Library/Preferences/SystemConfiguration/preferences.plist. I found out that you have to match up the Sets field with the NetworkServices field. They look like GUIDs.

preferences

matpie
  • 17,033
  • 9
  • 61
  • 82