本文整理了Java中org.xbill.DNS.Address.getByName()
方法的一些代码示例,展示了Address.getByName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Address.getByName()
方法的具体详情如下:
包路径:org.xbill.DNS.Address
类名称:Address
方法名:getByName
暂无
代码示例来源:origin: internetarchive/heritrix3
if (address == null) {
address = Address.getByName(host);
代码示例来源:origin: org.apache.james/apache-jspf
private static String getConvertedIP(String ip) throws UnknownHostException {
// Convert the ip if its an ipv6 ip. For ipv4 no conversion is needed
return Address.getByName(ip).getHostAddress();
}
代码示例来源:origin: org.apache.james.jspf/apache-jspf-resolver
private static String getConvertedIP(String ip) throws UnknownHostException {
// Convert the ip if its an ipv6 ip. For ipv4 no conversion is needed
return Address.getByName(ip).getHostAddress();
}
代码示例来源:origin: com.helger/ph-network
@Nullable
public static InetAddress resolveByName (@Nonnull final String sHostName)
{
try
{
return Address.getByName (sHostName);
}
catch (final UnknownHostException ex)
{
return null;
}
}
代码示例来源:origin: optimaize/webcrawler-verifier
/**
* TODO how are timeouts handled? Why doesn't dnsjav document exceptions?
* @return Absent for unknown host.
*/
private static Optional<InetAddress> getIpByHost(String hostName) {
//TODO do I need to use dnsServers here in case they are set?
try {
InetAddress addr = Address.getByName(hostName);
return Optional.of(addr);
} catch (UnknownHostException e) {
return Optional.absent();
}
}
代码示例来源:origin: sensepost/yeti
ipAddress = Address.getByName(mxServer).getHostAddress();
} catch (UnknownHostException ex) {
Logger.getLogger(ForwardLookupHelper.class.getName()).log(Level.SEVERE, null, ex);
代码示例来源:origin: sensepost/yeti
String ipAddress = Address.getByName(nsServer).getHostAddress();
String realDomain = NetworkTools.getDomainFromHost(nsServer);
ForwardLookupResult fr;
代码示例来源:origin: sensepost/yeti
String ipAddress = Address.getByName(hostName).getHostAddress();
foundSubDomain.setIpAddress(ipAddress);
} catch (UnknownHostException ex) {
String ipAddress = Address.getByName(alias).getHostAddress();
foundAliasDomain.setIpAddress(ipAddress);
} catch (UnknownHostException ex) {
代码示例来源:origin: apache/attic-whirr
private void checkResponse(String reverse, NetworkInterface networkInterface, InetAddress inetAddress) {
if (inetAddress.toString().substring(1).equals(reverse)) {
LOG.info(String.format("InetAddress %s on interface %s does not have reverse dns name, " +
"so their reverse remains: %s", inetAddress, networkInterface.getDisplayName(), reverse));
} else {
if (inetAddress.isLoopbackAddress()) {
LOG.info(String.format("InetAddress %s on loopback interface %s obtained reverse name as %s",
inetAddress, networkInterface.getDisplayName(), reverse));
} else {
LOG.info(String.format("InetAddress %s on interface %s has reverse dns name: %s\n",
inetAddress, networkInterface.getDisplayName(), reverse));
try {
InetAddress checkedAddr = Address.getByName(reverse);
assertEquals(inetAddress, checkedAddr);
} catch (UnknownHostException uhex) {
fail("InetAddress " + inetAddress + " on interface " + networkInterface.getDisplayName() +
" got " + reverse + " reverse dns name which in return is an unknown host!");
}
}
}
}
代码示例来源:origin: org.archive.heritrix/heritrix-modules
if (address == null) {
address = Address.getByName(host);
内容来源于网络,如有侵权,请联系作者删除!