我可以使用confstr 设置两个名称服务器吗?

发布于 2024-07-09 22:47:27 字数 319 浏览 5 评论 0原文

我正在尝试在 QNX 系统中设置两个动态名称服务器 IP 地址。 我已经能够使用confstr 通过将_nameserver=xxx.xxx.xxx.xxx 字符串设置到_CS_RESOLVE 中来设置地址。 然后 res_search 返回给定名称的正确 IP 地址。 我实际上有两个问题:

  1. 如何使用 setconf 设置两个名称服务器(主要和辅助)?

  2. 如果名称服务器 IP 地址发生变化,我可以在应用程序运行时再次调用 setconf 来更改它们吗?

    如果名称服务器 IP 地址发生变化,我

I am trying to set two dynamic nameserver IP addresses in my QNX system. I have been able to use confstr to set up an address by setting a _nameserver=xxx.xxx.xxx.xxx string into _CS_RESOLVE. Then res_search returns the correct IP address for a given name. I actually have two questions:

  1. How do I set up two nameservers (primary and secondary) using setconf?

  2. If the nameserver IP addresses change, can I just call setconf again to change them while my application is running?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ぽ尐不点ル 2024-07-16 22:47:27

根据 QNX 文档,您的 confstr() 设置需要包含:(

nameserver_1.2.3.4
nameserver_5.6.7.8

即每个名称服务器一行,最多三行)

如果名称服务器发生更改,您可能需要调用 res_init() 来强制解析器库以使用新设置。

According to the QNX docs, your confstr() setting needs to contain:

nameserver_1.2.3.4
nameserver_5.6.7.8

(i.e. one line per nameserver, with a maximum of three)

If the nameservers change, you'll probably need to call res_init() to force the resolver library to use the new settings.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文