The _res Data Structure

Global information used by these resolver calls is kept in the _res data structure. This structure is defined in the <RESOLV.H> file and contains the following members:

┌─────────────────────────────────────────────────────────────────┐
│Type                  Member                Contents             │
├─────────────────────────────────────────────────────────────────┤
│int                   retrans               Retransmission time  │
│                                            interval             │
├─────────────────────────────────────────────────────────────────┤
│int                   retry                 Number of times to   │
│                                            retransmit           │
├─────────────────────────────────────────────────────────────────┤
│long                  options               Option flags         │
├─────────────────────────────────────────────────────────────────┤
│int                   nscount               Number of name       │
│                                            servers              │
├─────────────────────────────────────────────────────────────────┤
│struct                nsaddr_list           Address of name      │
│sockaddr_in[MAXNS]                          server               │
├─────────────────────────────────────────────────────────────────┤
│unsigned short        id                    Current packet id    │
├─────────────────────────────────────────────────────────────────┤
│char[MAXDNAME]        defdname              Default domain       │
├─────────────────────────────────────────────────────────────────┤
│char*[MAXDNSRCH+1]    dnsrch                Components of domain │
│                                            to search            │
└─────────────────────────────────────────────────────────────────┘

The options field of the _res data structure is constructed by logically ORing the following values:

RES_INIT

RES_DEBUG RES_USEVC RES_STAYOPEN RES_RECURSE RES_DEFNAMES

These environment variables affect values related to the _res data structure:

LOCALDOMAIN

RES_TIMEOUT RES_RETRY

The res_send() call does not perform interactive queries and expects the name server to handle recursion.


[Back: Domain Name Resolution]
[Next: Ports]