Add proxy exceptions from command-line on Ubuntu GNOME


To change proxy settings from cli in GNOME-based Ubuntu desktop, it’s possible to use gsettings commands.

To see the current proxy exceptions, type the following command on linux console

gsettings get org.gnome.system.proxy ignore-hosts

The option ignore-hosts means the proxy exceptions. In this case the default output should be something like [‘localhost’, ‘127.0.0.0/8’, ‘::1’] , i.e. the local hostname and addresses (‘127.0.0.0/8’ is the address block for loopback and ‘::1’ is the IPv6 loopback address).

To change proxy exceptions, use something like the following command

gsettings set org.gnome.system.proxy ignore-hosts “[‘localhost’, ‘127.0.0.0/8’, ‘192.168.1.0/24’, ‘192.168.2.0/24’, ‘mylocalwebsite.local’, ‘::1’]”

In this example we add to proxy exception all the domanis with wildcard “*mylocalwebsite.local” and all the addresses in networks 192.168.1.0 and 192.168.2.0.
Settings will be mantained also after reboots.

Leave a comment

Your email address will not be published. Required fields are marked *