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

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

Introduction

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

Prototype

@Fluent
DnsClient lookup4(String name, Handler<AsyncResult<@Nullable String>> handler);

Source Link

Document

Try to lookup the A (ipv4) record for the given name.

Usage

From source file:examples.DNSExamples.java

License:Open Source License

public void example3(Vertx vertx) {
    DnsClient client = vertx.createDnsClient(53, "10.0.0.1");
    client.lookup4("vertx.io", ar -> {
        if (ar.succeeded()) {
            System.out.println(ar.result());
        } else {//from   www . ja  v  a  2  s  .com
            System.out.println("Failed to resolve entry" + ar.cause());
        }
    });
}