The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-15-2008
uunniixx uunniixx is offline
Registered User
 

Join Date: May 2008
Posts: 8
gethostbyname_r returns NULL when hostname has dash

We have a code to find the DNS entry of a host that has a trailing '-' in its url (format example: mysite-.watch.com):

if(gethostbyname_r(host,host_ent,host_buffer,host_buffer_size,&host_error)==NULL)
{
//failed
}

But when remove the '-' from the host name the code does not return failure. IE and nslookup works fine.

What we need to do in such a case?

Last edited by uunniixx; 05-15-2008 at 06:20 PM.
Reply With Quote
Forum Sponsor