c++ - Programmatically set DNS nameserver on Linux -


i'd able add ip addresses dns nameservers on linux c/c++ program. i'm on embedded platform read-only /etc/resolv.conf. means can't add "nameserver xxx.xxx.xxx.xxx" line file without little trickery. there clean ways code?

i try symlinking /etc/resolv.conf file in tmpfs, seems hackish , feels should able without writing file.

have @ nsaddr_list in resolv.conf libc.

this question says:

although not documented, common way set resolver used update _res.nsaddr_list.

in uclibc 0.9.31 there comment on line 533 in resolv.c describing how works.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -