[X-Apps] gethostbyname("just the nmachine name ") not working

wes wgriffin at jtan.com
Mon Mar 3 07:04:48 PST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday, March 2, 2003, at 11:31 PM, Arul Jeyananth wrote:

> Hi,
> gethostbyname("ip address of a macine in  the network") works fine .
> gethostbyname("just the nmachine name ") not working.
> But If I give the machine name, and the host file not having any entry 
> about
> the machine and there is no name for that machine in the DNS, that call
> fails
>
> Plese suggest some ways to rectify this problem

please use getaddrinfo() and getnameinfo() instead of gethostbyname(). 
these are the newer apis that handle ipv6 and they usually are better 
behaved than gethostbyname().

- -- 
wes / wgriffin at jtan.com / 000f1a2f

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQEVAwUBPmNvFi4xMyMADxovAQJ/WwgAkqvzq59NWq2GmDCAPqwQnR+zDf6g/nlH
VLkYZOJYMtLZvq4vANPfUDBC1ibvdH5ygxBencBlwHnwvIZobNxzVb+mV+jFUzr4
kCb0RFZ6Xo6HjPEbtkld1IVjNK4a9h4ZOSTX7iyNhegrYg7nhjlCGSlx+sDjsBOW
Tb+Hb5XOxZkq+ygLNosFoguOZ+CPxAtCX7lmQGX7+LT63Y1TBvHDJ0zCpphuzTnk
T+9torOOq2QjziLx3RYsDW61lDhz90bJAMQpCb0mkBEo6dFJBq4AkGKKFBlz1cb/
LjbxS28nKgdzWo8mcGq/HL5LDhu3hrPzaQ0NDV94OyKWr9H8iPeYLg==
=oTeC
-----END PGP SIGNATURE-----



More information about the X-Apps mailing list