• <bdo id='OLf5U'></bdo><ul id='OLf5U'></ul>

    <tfoot id='OLf5U'></tfoot>
    <i id='OLf5U'><tr id='OLf5U'><dt id='OLf5U'><q id='OLf5U'><span id='OLf5U'><b id='OLf5U'><form id='OLf5U'><ins id='OLf5U'></ins><ul id='OLf5U'></ul><sub id='OLf5U'></sub></form><legend id='OLf5U'></legend><bdo id='OLf5U'><pre id='OLf5U'><center id='OLf5U'></center></pre></bdo></b><th id='OLf5U'></th></span></q></dt></tr></i><div id='OLf5U'><tfoot id='OLf5U'></tfoot><dl id='OLf5U'><fieldset id='OLf5U'></fieldset></dl></div>

      <small id='OLf5U'></small><noframes id='OLf5U'>

      1. <legend id='OLf5U'><style id='OLf5U'><dir id='OLf5U'><q id='OLf5U'></q></dir></style></legend>
      2. c-ares 为 DNS 解析指定网络接口

        c-ares specifying network interface for the DNS resolves(c-ares 为 DNS 解析指定网络接口)
        <tfoot id='97ZFA'></tfoot>

        • <legend id='97ZFA'><style id='97ZFA'><dir id='97ZFA'><q id='97ZFA'></q></dir></style></legend>
        • <i id='97ZFA'><tr id='97ZFA'><dt id='97ZFA'><q id='97ZFA'><span id='97ZFA'><b id='97ZFA'><form id='97ZFA'><ins id='97ZFA'></ins><ul id='97ZFA'></ul><sub id='97ZFA'></sub></form><legend id='97ZFA'></legend><bdo id='97ZFA'><pre id='97ZFA'><center id='97ZFA'></center></pre></bdo></b><th id='97ZFA'></th></span></q></dt></tr></i><div id='97ZFA'><tfoot id='97ZFA'></tfoot><dl id='97ZFA'><fieldset id='97ZFA'></fieldset></dl></div>

        • <small id='97ZFA'></small><noframes id='97ZFA'>

              <tbody id='97ZFA'></tbody>
              <bdo id='97ZFA'></bdo><ul id='97ZFA'></ul>

                  本文介绍了c-ares 为 DNS 解析指定网络接口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有办法设置DNS请求可以绑定到的网络接口.

                  Is there a way in which you can set the network interface to which the DNS requests can be bound to.

                  我们有一个项目需要使用高优先级流会话通过一个接口,所有其他请求通过第二个接口.

                  We have a project which requires to use a highpriority streaming session go through one interface and all the other requests channeled through the second one.

                  示例:设置 'eth0' 以便所有 ares 请求都通过 'eth0' 而不是在 'wlan0' 上.

                  example: setting 'eth0' so that all the ares requests will go through 'eth0' and not on 'wlan0'.

                  我在 c-ares(在 ares_init_options() API 中)找不到任何提供此设置界面选项的 API.

                  I was not able to find any API in c-ares (in ares_init_options() API) that gives this option of setting interface.

                  如果有什么方法可以做到这一点,或者我错过了什么,请告诉我.

                  Can you please let me know if there is some way to achive this or if I missed something.

                  谢谢,阿俊

                  推荐答案

                  如果你有一个相当新的 c-ares (c-ares >= 1.7.4),请查看 ares.h(这是我唯一的地方实际上发现它被引用了).

                  If you have a fairly new c-ares (c-ares >= 1.7.4), check out ares.h (It's the only place I've actually found it referenced).

                  /* These next 3 configure local binding for the out-going socket
                   * connection.  Use these to specify source IP and/or network device
                   * on multi-homed systems.
                   */
                  CARES_EXTERN void ares_set_local_ip4(ares_channel channel, unsigned int local_ip);
                  
                  /* local_ip6 should be 16 bytes in length */
                  CARES_EXTERN void ares_set_local_ip6(ares_channel channel,
                                                       const unsigned char* local_ip6);
                  
                  /* local_dev_name should be null terminated. */
                  CARES_EXTERN void ares_set_local_dev(ares_channel channel,
                                                       const char* local_dev_name);
                  

                  这篇关于c-ares 为 DNS 解析指定网络接口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Is Type(::x); valid?(是类型(::x);有效的?)
                  Difference between an inline function and static inline function(内联函数和静态内联函数的区别)
                  Compilation fails randomly: quot;cannot open program databasequot;(编译随机失败:“无法打开程序数据库)
                  Too many initializers error for a simple array in bcc32(bcc32 中的简单数组的初始值设定项过多错误)
                  No Member named stoi in namespace std(命名空间 std 中没有名为 stoi 的成员)
                  Error using a constexpr as a template parameter within the same class(在同一个类中使用 constexpr 作为模板参数时出错)

                  • <legend id='UTOY3'><style id='UTOY3'><dir id='UTOY3'><q id='UTOY3'></q></dir></style></legend>

                  • <tfoot id='UTOY3'></tfoot>
                  • <i id='UTOY3'><tr id='UTOY3'><dt id='UTOY3'><q id='UTOY3'><span id='UTOY3'><b id='UTOY3'><form id='UTOY3'><ins id='UTOY3'></ins><ul id='UTOY3'></ul><sub id='UTOY3'></sub></form><legend id='UTOY3'></legend><bdo id='UTOY3'><pre id='UTOY3'><center id='UTOY3'></center></pre></bdo></b><th id='UTOY3'></th></span></q></dt></tr></i><div id='UTOY3'><tfoot id='UTOY3'></tfoot><dl id='UTOY3'><fieldset id='UTOY3'></fieldset></dl></div>
                      <tbody id='UTOY3'></tbody>
                      • <bdo id='UTOY3'></bdo><ul id='UTOY3'></ul>

                            <small id='UTOY3'></small><noframes id='UTOY3'>