How to specify that Yum should not use proxy for specific domain

PROXYyum

Is it possible to specify domain for which yum should bypass proxy configuration ?
I'm afraid this is not possible…

I read that it was possible to use the environment variable HTTP_PROXY then NO_PROXY, is it the most elegant solution?

[EDIT]

I tried the solution with the environment variables:

export HTTP_PROXY=http://user:pass@host:port
export http_proxy=http://user:pass@host:port
export no_proxy=.domain
export NO_PROXY=.domain

Yum uses proxy but the repos *.domain are not bypassed.

[WORKAROUND]

Using http://cntlm.sourceforge.net/ I can configure which domain should be ignore. But this wotks only with proxy that requires NTLM authentication…

Best Answer

I have not been able to get this to work using environment variables as you describe here. Yum does support proxies itself, however, and you should be able to do something like this:

proxy=http://proxy:port

Into yum.conf and then adding

proxy=_none_

Into the repo definitions you don't want to access via the global proxy. This is detailed (albeit succinctly) in the yum.conf man page.