???????????
?????????Internet????????????????Internet?????IP???????????????????IP???????????????????????(DNS)??DNS????????????????????????????????????IP??????????????????????????IP??????????????????????IP???????DNS????????????????????????????????????????Web???????????????????????
????????????IP?????
????IP?????IP????32???128λ???????????????????Э?飬UDP??TCPЭ?鶼???????????????????
????1?????????
?????????????????????????????????????????????????????????????????
?????????????(?????????????)??????????????????????????????????????????????н???
????2??IP??Χ
????????????????????????????????????????????????á???????????·???????????
??????????????????????????????????????????
?????????????Internet??????
????3??IP??????????????
????IP?????????????????????????е??
????IPV4??????д????????????????????Χ??0??255?????????????????θ????eg??192.168.1.119??
????????InetAddress??
????InetAddress??????????Э??(IP)???????Java??IP???????????????????????????????
????InetAddress??????????IP?????????????????????????(????????????????????????????????з?????????????)??
????1??????InetAddress????
????InetAddress????й???????????????????侲???????????????????InetAddress????
????static InetAddress[]getAllByName(String host)
????Given the name of a host?? returns an array of its IP addresses?? based on the configured name service on the system.
????static InetAddressgetByName(String host)
????Determines the IP address of a host?? given the host's name.
????static InetAddressgetLocalHost()
????Returns the address of the local host.
????ps:??????????????Щ???????????????????????????????Σ??????????????????????????????????????????????????????????????????????????????????
????????DNS????????????InetAddress???????????????????networkaddress.cache.ttl????????DNS??????Java?????б????????????????InetAddress???е????????棬??????????????????????????Internet???????????DNS?????????????????????
????2??????
booleanequals(Object obj)
Compares this object against the specified object.
byte[]getAddress()
Returns the raw IP address of this InetAddress object.
static InetAddress[]getAllByName(String host)
Given the name of a host?? returns an array of its IP addresses?? based on the configured name service on the system.
static InetAddressgetByAddress(byte[] addr)
Returns an InetAddress object given the raw IP address .
static InetAddressgetByAddress(String host?? byte[] addr)
Creates an InetAddress based on the provided host name and IP address.
static InetAddressgetByName(String host)
Determines the IP address of a host?? given the host's name.
StringgetCanonicalHostName()
Gets the fully qualified domain name for this IP address.
StringgetHostAddress()
Returns the IP address string in textual presentation.
StringgetHostName()
Gets the host name for this IP address.
static InetAddressgetLocalHost()
Returns the address of the local host.
static InetAddressgetLoopbackAddress()
Returns the loopback address.
inthashCode()
Returns a hashcode for this IP address.