32

I am trying to bypass the proxy for all addresses that are local network addresses. Such as http://test/ and http://mymachine/ and http://theirmachine/

Is there an easy way to do that?

2
  • easier then a gui, i would try the command line using gconftool.
    – nelaaro
    May 12, 2011 at 12:03
  • have a look at this file ~/.conf/system/http-proxy/%gconf.xml. You would still need to update the system some how. Still looking into that.
    – nelaaro
    May 12, 2011 at 12:06

4 Answers 4

37

How are proxy settings set in the Ubuntu gnome environment.

These methods are not full proof and can break the configuration of the system. Making the network behave in an undesired way. Only do this if you understand how it affects different parts of the system.

You can set some of the proxy settings here. But for ignore hosts you will need to set that else where.

$ cat /etc/environment 
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
http_proxy="http://192.168.1.250:8080/"
ftp_proxy="ftp://192.168.1.250:8080/"
https_proxy="https://192.168.1.250:8080/"

The env command is related to the above file but many programs and system utilities make changes to the environment. More info can be found here, read this before making changes. https://help.ubuntu.com/community/EnvironmentVariables

$ env | grep proxy
http_proxy=http://192.168.1.250:8080/
ftp_proxy=ftp://192.168.1.250:8080/
all_proxy=socks://192.168.1.250:8080/
https_proxy=https://192.168.1.250:8080/
no_proxy=localhost,127.0.0.0,127.0.1.1,127.0.1.1,local.home

simply change this by

no_proxy=myhost_to_ignore,$no_proxy
export no_proxy

We need to add back the list of previously set no_proxy hence we add it back at the end of the line. This is only applicable to the terminal session that the command is run in and will not apply system wide read the community help documentation to make permanent changes.

To make changes in the gnome environment you can use the gconftool. Read the following guide before attempting to make changes.
http://library.gnome.org/admin/system-admin-guide/stable/gconf-0.html.en

Here are instructions on changing proxy settings using the gconftool
http://library.gnome.org/admin/system-admin-guide/stable/gconf-8.html.en#gconf-10

$ gconftool --recursive-list /system/http_proxy 
use_authentication = false
authentication_password = 
authentication_user = 
ignore_hosts =[localhost,127.0.0.0/8,127.0.1.1]
use_http_proxy = true
port = 8080
use_same_proxy = true
host = 192.168.1.250

The following file ~/.conf/system/http-proxy/%gconf.xml. Will be changed by the next command. I am unsure how to set a list type with gconftool. MY attempts ended up removing all the previous settings.

I am sure their is a better way to do this!!
Safe way to do it. get the current contents of the /system/http_proxy/ignore_hosts

gconftool -g  /system/http_proxy/ignore_hosts  

Next copy its contents into the next command and add the host you want to add.

gconftool  --type list --list-type string  -s /system/http_proxy/ignore_hosts '[localhost,127.0.0.0/8,myhost]'
2
  • The answer is misleading. no_proxy does not support wildcard or CIRD.
    – petertc
    Mar 9, 2017 at 7:59
  • 1
    gconftool is the older alternative to gsettings. Now would be gsettings list-recursively org.gnome.system.proxy Oct 24, 2022 at 18:22
3

Assuming you're using the default Ubuntu Gnome desktop: You need to add your local host addresses to the ignore list in the gnome proxy settings:

alt text

5
  • 1
    I know about this, what I'm wondering is there anyway to add all addresses that do not have a domain... such as intranet or sharepoint to this site implicitly. It would really suck to have to add thousands of ignore entries.
    – spoon16
    Nov 4, 2010 at 4:38
  • 1
    That wasn't your question though. You asked how to ignore localhost addresses, this is how you do that. You should use the *.local address for all your localhost services anyway, that will make it easier to specify in this ignore list. But I don't know why you would have thousands of localhost services, could you explain? Nov 4, 2010 at 4:46
  • Using either .local when using mDNS/Avahi or some other LAN domain when using DNS (including when using something like Active Directory) is a good idea indeed.
    – JanC
    Nov 4, 2010 at 11:44
  • Owens, my question was how to ignore ALL local host addresses. I reread it, I think the wording is clear :) I work at a very large organization, internal resources are not referred to locally with any sort of domain identifer in hrefs and there are literally thousands of domain local resources on the network.
    – spoon16
    Nov 4, 2010 at 17:29
  • Then you mean 'local network' not 'local host'. Although I maintain that a properly configured network would have only a handful of common domains. Your network seems misconfigured, but if you can't do anything about that now, then you could make a script and download the local dns repository parse it and put them all in ignores which are all stored in gconf. I don't think there is any existing way to do that, although perhaps a feature bug would be a good place to start from. Nov 5, 2010 at 8:21
2

I have come across with this problem. in my case I have Ubuntu 14.04 and I found solution here

You can install dconf-editor and open dconf-editor -> system -> proxy by using this editor, than add your hosts to ignore-hosts on this window and that's all.

0
0

Our IT department was able to provide an auto configuration URL that includes all of the appropriate ignore patterns and hosts for our domain. This is definitely the easiest way to go if it is available to you.

Not the answer you're looking for? Browse other questions tagged .