Package org.apache.drill.exec.udfs
Class DNSUtils
java.lang.Object
org.apache.drill.exec.udfs.DNSUtils
Utility class which contains various methods for performing DNS resolution and WHOIS lookups in Drill UDFs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
getDNS
(String domainName, String resolverName, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs the actual DNS lookup and returns the results in aBaseWriter.ComplexWriter
.static void
getDNS
(String domainName, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs the actual DNS lookup and returns the results in aBaseWriter.ComplexWriter
.static void
whois
(String domainName, String whoisServer, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs a WHOIS lookup and populates the results into a Drill map.static void
whois
(String domainName, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs a WHOIS lookup and populates the results into a Drill map.
-
Constructor Details
-
DNSUtils
public DNSUtils()
-
-
Method Details
-
getDNS
public static void getDNS(String domainName, String resolverName, BaseWriter.ComplexWriter out, DrillBuf buffer) throws org.xbill.DNS.TextParseException Performs the actual DNS lookup and returns the results in aBaseWriter.ComplexWriter
. If the resolver is not null, we will use the provided resolver. If a resolver is not provided, we'll use the local cache.Relating to the resolver, you can specify an IP or host, or you can use a name of a known resolver. Known resolvers are:
- cloudflare
- cloudflare_secondary
- google_secondary
- verisign
- verisign_secondary
- yandex
- yandex_secondary
- Parameters:
domainName
- AString
of a domain for which you want to look up.resolverName
- AString
containing the resolver name.out
- TheBaseWriter.ComplexWriter
to which the DNS results will be written.buffer
- TheDrillBuf
to which the data will be written.- Throws:
org.xbill.DNS.TextParseException
- If the resolver is unparsable, throw an exception.
-
getDNS
public static void getDNS(String domainName, BaseWriter.ComplexWriter out, DrillBuf buffer) throws org.xbill.DNS.TextParseException Performs the actual DNS lookup and returns the results in aBaseWriter.ComplexWriter
. Uses the local cache as the DNS resolver.- Parameters:
domainName
- AString
of a domain for which you want to look up.out
- TheBaseWriter.ComplexWriter
to which the DNS results will be written.buffer
- TheDrillBuf
to which the data will be written.- Throws:
org.xbill.DNS.TextParseException
- If the domain is unparsable, throw an exception.
-
whois
Performs a WHOIS lookup and populates the results into a Drill map. This method uses a default server.- Parameters:
domainName
- The input domain name.out
- ABaseWriter.ComplexWriter
to which the results will be writtenbuffer
- ADrillBuf
which contains the output
-
whois
public static void whois(String domainName, String whoisServer, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs a WHOIS lookup and populates the results into a Drill map. This method uses a default server.- Parameters:
domainName
- The input domain name.whoisServer
- AString
containing the whois serverout
- ABaseWriter.ComplexWriter
to which the results will be writtenbuffer
- ADrillBuf
which contains the output
-