My company uses a very simple http browser implemenation written in
gnu C++ to asynchronously post data to customers. We use
gethostbyname_r to convert FQDN to IP address, then set up a socket,
set the headers, send the data, etc.
One of our customers has a host name with a trailing slash, i.e their
FQDN is like
The various glibc library DNS lookup functions fail when looking up
this FQDN. I tried gethostbyname_r and getaddrinfo. gethostbyname_r
returns NO_RECOVERY. getaddrinfo returns EAI_NONAME. I've tried this
on RH 6.2, and on RHEL 3 and 4.
nslookup, host, and dig all find this name with no problem.
AFAIKT from looking at IETF specs, the trailing slash is illegal. But
I don't want to have to tell my customer to change his host name.
What are the nslookup, host, and dig commands doing differently to
lookup the name than what is done in the glibc functions?
Thanks for the help!