# resolv names via env var ?

## doublehp

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.

----------

## khayyam

 *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

----------

