Package io.vertx.core.dns
Interface DnsClient
-
public interface DnsClientProvides a way to asynchronously lookup information from DNS servers.Please consult the documentation for more information on DNS clients.
The client is thread safe and can be used from any thread.
- Author:
- Norman Maurer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Future<Void>close()Close the client.Future<String>lookup(String name)Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name.Future<String>lookup4(String name)Try to lookup the A (ipv4) record for the given name.Future<String>lookup6(String name)Try to lookup the AAAA (ipv6) record for the given name.Future<List<String>>resolveA(String name)Try to resolve all A (ipv4) records for the given name.Future<List<String>>resolveAAAA(String name)Try to resolve all AAAA (ipv6) records for the given name.Future<List<String>>resolveCNAME(String name)Try to resolve the CNAME record for the given name.Future<List<MxRecord>>resolveMX(String name)Try to resolve the MX records for the given name.Future<List<String>>resolveNS(String name)Try to resolve the NS records for the given name.Future<String>resolvePTR(String name)Try to resolve the PTR record for the given name.Future<List<SrvRecord>>resolveSRV(String name)Try to resolve the SRV records for the given name.Future<List<String>>resolveTXT(String name)Try to resolve the TXT records for the given name.default Future<String>reverseLookup(String ipaddress)Try to do a reverse lookup of an IP address.
-
-
-
Method Detail
-
lookup
Future<String> lookup(String name)
Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name. The first found will be used.- Parameters:
name- the name to resolve- Returns:
- a future notified with the resolved address if a record was found. If none was found it
will get notified with
null. If an error occurs it will get failed.
-
lookup4
Future<String> lookup4(String name)
Try to lookup the A (ipv4) record for the given name. The first found will be used.- Parameters:
name- the name to resolve- Returns:
- a future notified with the resolved
Inet4Addressif a record was found. If none was found it will get notified withnull. If an error occurs it will get failed.
-
lookup6
Future<String> lookup6(String name)
Try to lookup the AAAA (ipv6) record for the given name. The first found will be used.- Parameters:
name- the name to resolve- Returns:
- a future notified with the resolved
Inet6Addressif a record was found. If none was found it will get notified withnull. If an error occurs it will get failed.
-
resolveA
Future<List<String>> resolveA(String name)
Try to resolve all A (ipv4) records for the given name.- Parameters:
name- the name to resolve- Returns:
- a future notified with a
Listthat contains all the resolvedInet4Addresses. If none was found an emptyListwill be used. If an error occurs it will get failed.
-
resolveAAAA
Future<List<String>> resolveAAAA(String name)
Try to resolve all AAAA (ipv6) records for the given name.- Parameters:
name- the name to resolve- Returns:
- a future notified with a
Listthat contains all the resolvedInet6Addresses. If none was found an emptyListwill be used. If an error occurs it will get failed.
-
resolveCNAME
Future<List<String>> resolveCNAME(String name)
Try to resolve the CNAME record for the given name.- Parameters:
name- the name to resolve the CNAME for- Returns:
- a future notified with the resolved
Stringif a record was found. If none was found it will get notified withnull. If an error occurs it will get failed.
-
resolveMX
Future<List<MxRecord>> resolveMX(String name)
Try to resolve the MX records for the given name.- Parameters:
name- the name for which the MX records should be resolved- Returns:
- a future notified with a List that contains all resolved
MxRecords, sorted by theirMxRecord.priority(). If none was found it will get notified with an emptyList. If an error occurs it will get failed.
-
resolveTXT
Future<List<String>> resolveTXT(String name)
Try to resolve the TXT records for the given name.
-
resolvePTR
Future<String> resolvePTR(String name)
Try to resolve the PTR record for the given name.- Parameters:
name- the name to resolve the PTR for- Returns:
- a future notified with the resolved
Stringif a record was found. If none was found it will get notified withnull. If an error occurs it will get failed.
-
resolveNS
Future<List<String>> resolveNS(String name)
Try to resolve the NS records for the given name.
-
resolveSRV
Future<List<SrvRecord>> resolveSRV(String name)
Try to resolve the SRV records for the given name.
-
reverseLookup
default Future<String> reverseLookup(String ipaddress)
Try to do a reverse lookup of an IP address. This is basically the same as doing trying to resolve a PTR record but allows you to just pass in the IP address and not a valid ptr query string.- Parameters:
ipaddress- the IP address to resolve the PTR for- Returns:
- a future notified with the resolved
Stringif a record was found. If none was found it will get notified withnull. If an error occurs it will get failed.
-
-