SYNTAX

       #include "dnsresolv.h"

       int dns_resolvconfip(char servers[512],uint32 scope[32]);

       int dns_transmit_start(struct dns_transmit *d,const char servers[512],
           int flagrecursive,const char *q,const char qtype[2],
           const char localip[16]);
       int dns_transmit_start6(struct dns_transmit *d,const char servers[512],
           int flagrecursive,const char *q,const char qtype[2],
           const char localip[16],const uint32 scopes[32]);

       int dns_sortip4((char *servers,unsigned int n);
       int dns_sortip6(char *servers,unsigned int n);
       int dns_sortip(char *servers,unsigned int n);


DESCRIPTION

       dns_resolvconfip reads the name servers defined in /etc/resolv.conf and
       uses ip6_ifscan to fetch their IPv4/IPv6 addresses together with the
       scope for the LLU address.  Up to 32 name servers can be specified.

       Apart from the system-wide /etc/resolv.conf the IP addresses of name
       servers can preferrably be provided by means of the environment
       variable $DNSCACHEIP for each user application. The variable
       $DNSCACHEIP may include up to 32 name server IP addresses separated by
       white spaces:

         DNSCACHEIP="10.0.1.53 fe80::1%lo0 ::1"

       dns_transmit_start and dns_transmit_start6 use the list of name server
       IP's for a recursive or none-recursive query q of type qtype starting
       from IP address localip for which the struct dns_transmit provides the
       required  book keeping information.  dns_transmit_start6 additionally
       is able to evaluate the given scope_id as information for the local
       interface in order to bind to the remote IPv6 LLU addresses. Usually
       scope_id defaults to 0.

       dns_sortip together with the companion routines dns_sortip4 and
       dns_sortip6 randomize the list of name server IPs upon call and as
       result the first address is used to facilitate the name lookup.
       dns_sortip will remove IPv6 addresses from the list given a ipv4socket.


SEE ALSO

       dns(3), ip4(3), ip6(3), socket_if(3)



                                                               qlibs:(dnsstub)

Man(1) output converted with man2html