“ getting ahosts”的输出是什么?


10

哪些字段打印getent ahosts DOMAIN

输出为getent hostsIP和主机名的简单组合。该getent ahosts有一个额外的第三场就是在我所有的测试中,无论是STREAMDGRAM还是RAW

输出为 getent hosts example.net

2001:500:88:200::10 example.net

和为 getent ahosts example.net

2001:500:88:200::10 STREAM example.net
2001:500:88:200::10 DGRAM  
2001:500:88:200::10 RAW    
192.0.43.10     STREAM 
192.0.43.10     DGRAM  
192.0.43.10     RAW

Answers:


9

getent ahosts用途getaddrinfo()和提取从addrinfo结构的值ai_addrai_socktype以及ai_canonname和打印出来,以便为:的IPv4 / IPv6地址插座型规范名称(如果有的话)。

SOCK_STREAM (reliable stream-oriented service or Stream Sockets)
SOCK_DGRAM (datagram service or Datagram Sockets)
SOCK_SEQPACKET (reliable sequenced packet service), or
SOCK_RAW (raw protocols atop the network layer).
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.