Example usage for io.vertx.core.dns DnsClient reverseLookup

List of usage examples for io.vertx.core.dns DnsClient reverseLookup

Introduction

In this page you can find the example usage for io.vertx.core.dns DnsClient reverseLookup.

Prototype

@Fluent
DnsClient reverseLookup(String ipaddress, Handler<AsyncResult<@Nullable String>> handler);

Source Link

Document

Try to do a reverse lookup of an IP address.

Usage

From source file:examples.DNSExamples.java

License:Open Source License

public void example15(Vertx vertx) {
    DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
    client.reverseLookup("10.0.0.1", ar -> {
        if (ar.succeeded()) {
            String record = ar.result();
            System.out.println(record);
        } else {/*from   w w w.  j av  a2s  .  c o m*/
            System.out.println("Failed to resolve entry" + ar.cause());
        }
    });
}