Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
resolv names via env var ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
doublehp
Guru
Guru


Joined: 11 Apr 2005
Posts: 473
Location: FRANCE

PostPosted: Thu Jun 28, 2012 7:26 am    Post subject: resolv names via env var ? Reply with quote

Hello, I am aware that name resolution USUALLY goes via resolv.conf, and that this detail can be changed via nsswitch.conf.

In Android, the DNS server is stored in an env var. How to make a classic Linux like Gentoo also resolv names via an env var, and possibly custom this aspect via nsswitch ?

Ie, I would do sth like this: replace "hosts: files dns" with "hosts: var files dns" ...

Then, same question for networks.

Thanks.
_________________
DEMAINE Benoît-Pierre (aka DoubleHP ) http://www.demaine.info/
>o_/ Coin coin coin \_o<
to contact me (MSN,ICQ, JABBER, Skype ... ) http://benoit.demaine.info/contact.png
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Thu Jun 28, 2012 1:40 pm    Post subject: Re: resolv names via env var ? Reply with quote

doublehp wrote:
[...] Ie, I would do sth like this: replace "hosts: files dns" with "hosts: var files dns" ...

doublehp ... this would require patching glibc. This facility is provided by /lib/libnss_files.so.2 and /lib/libnss_dns.so.2 and anything that calls 'gethostbyname' will refer to these to have it resolved. I'm not familair with anything that might provide 'var' but glibc is what would need changed in order to support such a thing.

HTH & best ...

khay
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum