Unix and Linux Discussions Tagged with host |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
2 |
11,108 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
10,099 |
Linux |
|
|
|
3 |
5,750 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
30,249 |
Solaris |
|
|
|
2 |
13,524 |
Red Hat |
|
|
|
1 |
11,112 |
Shell Programming and Scripting |
|
|
|
3 |
6,895 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
3,542 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
3,760 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
5,215 |
UNIX for Beginners Questions & Answers |
|
|
|
7 |
7,202 |
Shell Programming and Scripting |
|
|
|
5 |
2,904 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
2,837 |
Shell Programming and Scripting |
|
|
|
1 |
1,625 |
UNIX for Beginners Questions & Answers |
|
|
|
0 |
3,003 |
UNIX for Advanced & Expert Users |
|
|
|
5 |
9,161 |
UNIX Desktop Questions & Answers |
|
|
|
3 |
3,530 |
Shell Programming and Scripting |
|
|
|
7 |
6,302 |
IP Networking |
|
|
|
2 |
3,963 |
UNIX for Dummies Questions & Answers |
|
|
|
30 |
63,735 |
Solaris |
|
|
|
1 |
7,145 |
Solaris |
|
|
|
6 |
56,302 |
Solaris |
|
|
|
2 |
90,391 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
15,971 |
AIX |
|
|
|
3 |
14,821 |
Linux |
|
|
|
8 |
8,756 |
Solaris |
|
|
|
0 |
2,023 |
Security Advisories (RSS) |
|
|
|
5 |
4,372 |
Shell Programming and Scripting |
|
|
|
3 |
4,221 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
16,861 |
AIX |
|
|
|
4 |
8,044 |
Solaris |
|
|
|
1 |
98,387 |
UNIX for Dummies Questions & Answers |
|
|
|
4 |
3,802 |
Programming |
|
|
|
4 |
3,552 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
5,824 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
3,273 |
Solaris BigAdmin RSS |
|
|
|
6 |
94,916 |
Shell Programming and Scripting |
|
|
|
3 |
12,146 |
Solaris |
|
|
|
7 |
13,089 |
Linux |
|
|
|
16 |
5,882 |
Shell Programming and Scripting |
REALHOSTNAME(3) BSD Library Functions Manual REALHOSTNAME(3)
NAME
realhostname -- convert an IP number to the real host name
LIBRARY
System Utilities Library (libutil, -lutil)
SYNOPSIS
#include <libutil.h>
int
realhostname(char *host, size_t hsize, const struct in_addr *ip);
DESCRIPTION
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.
RETURN VALUES
The realhostname() function will return one of the following constants which are defined in <libutil.h>:
HOSTNAME_FOUND
A valid host name was found.
HOSTNAME_INCORRECTNAME
A host name was found, but it did not resolve back to the passed ip. host now contains the numeric value of ip.
HOSTNAME_INVALIDADDR
ip could not be resolved. host now contains the numeric value of ip.
HOSTNAME_INVALIDNAME
A host name was found, but it could not be resolved back to any ip number. host now contains the numeric value of ip.
SEE ALSO
gethostbyaddr(3), gethostbyname(3), inet_ntoa(3), realhostname_sa(3)
BSD
April 6, 1999 BSD