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
Post a Comment