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 voidgetDNS(String domainName, String resolverName, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs the actual DNS lookup and returns the results in aBaseWriter.ComplexWriter.static voidgetDNS(String domainName, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs the actual DNS lookup and returns the results in aBaseWriter.ComplexWriter.static voidwhois(String domainName, String whoisServer, BaseWriter.ComplexWriter out, DrillBuf buffer) Performs a WHOIS lookup and populates the results into a Drill map.static voidwhois(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- AStringof a domain for which you want to look up.resolverName- AStringcontaining the resolver name.out- TheBaseWriter.ComplexWriterto which the DNS results will be written.buffer- TheDrillBufto 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- AStringof a domain for which you want to look up.out- TheBaseWriter.ComplexWriterto which the DNS results will be written.buffer- TheDrillBufto 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.ComplexWriterto which the results will be writtenbuffer- ADrillBufwhich 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- AStringcontaining the whois serverout- ABaseWriter.ComplexWriterto which the results will be writtenbuffer- ADrillBufwhich contains the output
-