tfDnsDomainSearchAdd

Jump to: navigation, search

Table of Contents >> Application Reference >> DNS Resolver


#include <trsocket.h>


int tfDnsDomainSearchAdd (const char TM_FAR * domainNamePtr);


Function Description

Add a domain suffix to be appended when resolving a partial hostname, e.g. getaddrinfo("mailhost", ...). This function may be called more than once to build a list of domains. The constructed list is global to all interfaces. The domains you add are searched in the order that you add them and are searched prior to any domains that may be supplied by DHCP or DHCPv6. Domains must be provided in ASCII dotted form, e.g. "treck.com". If you try to add a domain that is already in the list, no error will be reported and the list will not be modified.

The Treck domain search feature must be enabled by uncommenting the following compile time macro in your trsystem.h.

#define TM_USE_DNS_DOMAIN_SEARCH


Parameters

  • domainNamePtr
    Pointer to the ASCII domain to add, e.g. "treck.com".


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid domain.
  • TM_EPERM
    tfDnsInit() has not yet been called.
  • TM_ENOBUFS
    Insufficient memory.


Table of Contents >> Application Reference >> DNS Resolver