vert-x3 / vertx-examples

Vert.x examples
Apache License 2.0
3.55k stars 2.09k forks source link

HttpClient request exception when host is a url #434

Open RebornTong opened 2 years ago

RebornTong commented 2 years ago
HttpClient client = vertx.createHttpClient(new HttpClientOptions());
client.request(HttpMethod.GET, "www.baidu.com", "").onSucess ....
io.netty.resolver.dns.DnsResolveContext$SearchDomainUnknownHostException: Search domain query failed. Original hostname: 'http://www.baidu.com' failed to resolve 'http://www.baidu.com.intra.net'. Exceeded max queries per resolve 4 
    at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1046) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:999) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:417) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:970) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:417) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:970) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:417) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.onResponse(DnsResolveContext.java:628) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext.access$400(DnsResolveContext.java:65) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:461) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:578) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:571) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:550) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:491) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:616) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:605) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:104) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsQueryContext.trySuccess(DnsQueryContext.java:200) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:192) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:1301) [netty-resolver-dns-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [netty-codec-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) [netty-transport-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.70.Final.jar:4.1.70.Final]
    at java.lang.Thread.run(Thread.java:834) [?:?]
vietj commented 2 years ago

it looks like your DNS is configured to use search domains with .intra.net

RebornTong commented 2 years ago

then how to configure a right DNS domain ?