GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
REALHOSTNAME(3) FreeBSD Library Functions Manual REALHOSTNAME(3)

realhostname
convert an IP number to the real host name

System Utilities Library (libutil, -lutil)

#include <libutil.h>

int
realhostname(char *host, size_t hsize, const struct in_addr *ip);

The function realhostname() converts ip to the corresponding host name. This is done by resolving ip to a host name and then ensuring that the host name resolves back to ip.

host must point to a buffer of at least hsize bytes, and will always be written to by this function.

If the name resolution does not work both ways or if the host name is longer than hsize bytes, inet_ntoa(3) is used to convert ip to an ASCII form.

If the string written to host is hsize bytes long, host will not be NUL terminated.

The realhostname() function will return one of the following constants which are defined in <libutil.h>:
A valid host name was found.
A host name was found, but it did not resolve back to the passed ip. host now contains the numeric value of ip.
ip could not be resolved. host now contains the numeric value of ip.
A host name was found, but it could not be resolved back to any ip number. host now contains the numeric value of ip.

gethostbyaddr(3), gethostbyname(3), inet_ntoa(3), realhostname_sa(3)

The realhostname() function first appeared in FreeBSD 3.2.
April 6, 1999 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.