Last updated on October 7, 2020 by Dan Nanni
When you are using a proxy, the "proxy exception list" (also known as "ignore-hosts list") is sometimes necessary. The proxy exception list basically tells an application or desktop (which uses a proxy) to not use the proxy for particular destinations or websites. The proxy exceptions are needed when you are trying to access web servers on local LAN or those with private IP addresses which are not reachable from outside. You need to directly connect to those web servers, not through the proxy.
Some applications (e.g., Firefox) come with their own in-app proxy settings. In this case, you can use the app-specific proxy settings to define proxy exceptions.
If you want to rely on the system-wide proxy settings of Ubuntu desktop, you can configure proxy exceptions as follows. Note that if you are looking to set up proxy exceptions in a headless server environment, refer to this tutorial instead.
On GNOME-based Ubuntu desktop, you can use the gsettings
command to adjust proxy settings from the command line, and that includes proxy exceptions.
Type the following command, and it will print the current proxy exception list (or "ignore-hosts" list) of your desktop.
$ gsettings get org.gnome.system.proxy ignore-hosts
['localhost', '127.0.0.0/8', '::1']
The default proxy exception list contains three local hostname and addresses. 127.0.0.0/8
is an address block resolved for loopback, and ::1
is the IPv6 loopback address.
To change proxy exceptions, use set
option with gsettings
command as follows.
$ gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '192.168.1.0/24', 'xmodulo.com', '::1']"
Permitted items in the proxy exception list are hostnames (e.g., www.cnn.com
), domains with wildcard (e.g., *.xmodulo.com
), IPv4/IPv6 addresses, or CIDR blocks (e.g., 192.168.1.0/24
).
Now verify that the proxy exception list is successfully modified.
$ gsettings get org.gnome.system.proxy ignore-hosts
['localhost', '127.0.0.0/8', '192.168.1.0/24', 'xmodulo.com', '::1']
The desktop settings modified by gsettings
are preserved across desktop reboots.
The graphical counterpart for gsettings
command-line tool is dconf-editor
.
First install it on your desktop.
$ sudo apt-get install dconf-editor
To configure proxy exceptions, launch dconf-editor
and go to system"->"proxy
on the left side bar.
Then on the right-side pane, modify ignore-hosts
field.
Similar to gsettings
, any change made with dconf-editor
remain permanent across system reboots.
This website is made possible by minimal ads and your gracious donation via PayPal or credit card
Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.
Xmodulo © 2021 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean