Tell me more ×  I'd like to be able to add IP addresses for DNS
nameservers on Linux from my C/C++ program. I'm on a somewhat
embedded platform with a read-only /etc/resolv.conf. This means
I can't simply add a "nameserver" line to the file without a
little trickery. Are there any clean ways to do this from code?
I could try symlinking /etc/resolv.conf to a file in tmpfs, but
that seems hackish and it feels like something I should be able
to do without writing to a file.  share|improve this question on
an embedded platform or thinclient it is ok to symlink to /tmp.
–  Paulo Scardine Feb 17 '11 at 20:26 Kinda hard to say without
knowing what the capabilities of your embedded platform. But
IMHO in embedded land sometimes beggars can't be choosers. – 
Terrance Feb 17 '11 at 20:27 add comment  1 Answer  up vote 1
down vote accepted  Have a look at nsaddr_list in resolv.conf
from your libc.  This question says:  Although not documented,
the common way to set the resolver used is to update
_res.nsaddr_list.  In uC