Gethostbyaddr (Perl)
Gethostbyaddr ADDR, addrtype
This function converts an address to a name (or modifies an address ). ADDR should be the binary network address of a packet, while addrtype should actually be af_inet (from the socket module ).
Brief description of gethostbyaddr:
Returns the host information corresponding to the given address.
# Include
Struct hostent far * Pascal far gethostbyaddr (const char
Far * ADDR, int Len, int type );
ADDR: pointer to the byte sequential address
I have been reviewing C Programming in Linux over the past two days. In addition to project requirements, I am still preparing for work. Every time I reviewed them, I had a new experience. I used to look at these two functions and thought they would
One, domain Name System (DNS) 1. Brief introductionDNS is primarily used for mapping between host names and IP addresses.The host name can be a simple name LJM, or it can be a fully qualified domain name ljm.localdomainbaidu.com and so on.2.
Today we talk about "pre-network programming". Content is miscellaneous, but all are in the network application development process often encounter problems. first, big, small, and network byte-orderSmall-endian byte-order: Little-endian, which
ExploitationWinsock programming is implemented in synchronous and asynchronous modes with clear logic and focus on applications. In the preemptive multi-task operating system (WinNt and Win2K) the efficiency of using multi-thread mode basically
This chapter describes functions for converting between names and numeric addresses: GetHostByName and gethostbyaddr are converted between host names and IP addresses , and Getservbyname and Getservbyport are Convert between the server name and the
In daily life, people often know the host domain name without knowing the host IP address, and the socket API is based on IP address, so need to use DNS domain name resolution server to parse.So the first simple introduction of the principle of DNS,
Today we see several functions that can be used to obtain the corresponding domain name ip address based on the ip address domain name. This is recorded. Gethostbynamel ($ hostname) obtains the IP address based on the domain name and returns an
How does php obtain the domain name IP address? the code function first looks at the following code. The two outputs are the same:
$ Dm = 'www .phpfensi.com ';
$ Ip = gethostbyname ($ dm );
Echo gethostbyaddr ($ ip );
Echo $ ip;
Gethostbyname
Ec (2); & nbsp; the Code is as follows: copy the code $ dmwww.111cn.net; $ ipgethostbyname ($ dm); echogethostbyaddr ($ ip); echo $ ip; the two outputs are the same, * gethostbyname syntax stringgethostbyname (stri script ec (2); script
The DNS Host entry contains DNS information about a domin name or IP address in DNS database.1 struct hostent{2 Char *h_name; 3 Char *h_aliases; 4 int H_addrtype; 5 int h_length; 6 Char * *h_addr_list; 7 };The Hostinfo program,
The code is as follows
Copy Code
$DM = ' www.111cn.net ';$ip = gethostbyname ($DM);echo gethostbyaddr ($IP);Echo $ip;
Two output results are the same,/*About gethostbyname syntax
String gethostbyname (String $hostname)
Article Title: Linux Network Programming-3. server and client information functions. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded
PHP is so tightly integrated with Web pages that it's easy to forget that the language can also be used to perform other functions--Data encryption, window application and interface programming are three examples. Since network programming is the
Network programming is a mysterious and complex art, and of course it is also very interesting. The PERL language provides a wide range of TCP/IP network functions, all of which are directly derived from the C language socket library
Use php to obtain the ip address of the client server .? Phpecho current script SERVER host name:. gethostbyaddr ($ _ SERVER [REMOTE_ADDR]). brhr; echo get the IP address of the SERVER where the PHP script (page) is currently running:. $ _
PHP is so tightly integrated with web pages that it is easy to forget that this language can also be used to execute other functions-data encryption, window application and interface programming are three examples. Since network programming is the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.