Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

per-user resolv.conf

Tags:

dns

My linux server has differnt users [u01 - u04], can I have each user use a specific resolv.conf?

for example:

u01:  nameserver=10.14.15.123
u02:  nameserver=10.14.15.124
u03:  nameserver=10.14.16.125
like image 227
cfpete Avatar asked Oct 21 '22 14:10

cfpete


1 Answers

Short answer is no, see resolv.conf(5). However if you really want this feature, you can reimplement the functions in resolver(3) in a shared library, and use ld-magic to override the originals, at least in dynamically linked applications.

like image 145
jbr Avatar answered Oct 25 '22 17:10

jbr