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.
Add Proxy Exceptions from the Command-Line
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.
['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.
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.
['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.
Add Proxy Exceptions via GUI
The graphical counterpart for gsettings command-line tool is dconf-editor.
First install it on your desktop.
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.
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!