为什么 netty 会抛出 UnknownHostException,即使它收到了名称服务器的响应?

Why netty throws UnknownHostException even though it received responses from nameservers?

Netty 收到来自名称服务器的主机响应。即使那样 netty 抛出异常 java.net.UnknownHostException.

Netty 请求 DNS:

2019-01-18 03:49:43,754-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-3] DEBUG - [id: 0xe17fa005] WRITE: [6617: /10.102.5.110:53], DefaultDnsQuestion(host.removed.by.me.com. IN A)
2019-01-18 03:49:43,754-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-3] DEBUG - [id: 0xe17fa005] WRITE: [7076: /10.102.5.110:53], DefaultDnsQuestion(host.removed.by.me.com. IN AAAA)
2019-01-18 03:49:43,754-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-3] DEBUG - [id: 0x60682291] WRITE: [21843: /10.102.5.109:53], DefaultDnsQuestion(host.removed.by.me.com. IN A)
2019-01-18 03:50:22,739-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-3] DEBUG - [id: 0x60682291] WRITE: [17567: /10.102.5.109:53], DefaultDnsQuestion(host.removed.by.me.com. IN AAAA)

域名服务器对主机的响应:

2019-01-18 03:50:22,739-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] DEBUG - [id: 0xe17fa005] RECEIVED: [6617: /10.102.5.110:53], DatagramDnsResponse(from: /10.102.5.110:53, to: /0.0.0.0:58780, 6617, QUERY(0), NoError(0), RD AA RA)
    DefaultDnsQuestion(host.removed.by.me.com. IN A)
    DefaultDnsRawRecord(host.removed.by.me.com. 3600 IN A 4B)
    DefaultDnsRawRecord(OPT flags:0 udp:4000 0B)
2019-01-18 03:50:22,739-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] WARN  - [id: 0xe17fa005] Received a DNS response with an unknown ID: 6617
2019-01-18 03:50:59,618-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] DEBUG - [id: 0xe17fa005] RECEIVED: [7076: /10.102.5.110:53], DatagramDnsResponse(from: /10.102.5.110:53, to: /0.0.0.0:58780, 7076, QUERY(0), NoError(0), RD AA RA)
    DefaultDnsQuestion(host.removed.by.me.com. IN AAAA)
    DefaultDnsRawRecord(removed.by.me.com. 3600 IN SOA 50B)
    DefaultDnsRawRecord(OPT flags:0 udp:4000 0B)
2019-01-18 03:50:59,618-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] WARN  - [id: 0xe17fa005] Received a DNS response with an unknown ID: 7076
2019-01-18 03:50:59,618-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] DEBUG - [id: 0x60682291] RECEIVED: [21843: /10.102.5.109:53], DatagramDnsResponse(from: /10.102.5.109:53, to: /0.0.0.0:58781, 21843, QUERY(0), NoError(0), RD AA RA)
    DefaultDnsQuestion(host.removed.by.me.com. IN A)
    DefaultDnsRawRecord(host.removed.by.me.com. 3600 IN A 4B)
    DefaultDnsRawRecord(OPT flags:0 udp:4000 0B)
2019-01-18 03:50:59,618-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] WARN  - [id: 0x60682291] Received a DNS response with an unknown ID: 21843
2019-01-18 03:50:59,634-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] DEBUG - [id: 0x60682291] RECEIVED: [17567: /10.102.5.109:53], DatagramDnsResponse(from: /10.102.5.109:53, to: /0.0.0.0:58781, 17567, QUERY(0), NoError(0), RD AA RA)
    DefaultDnsQuestion(host.removed.by.me.com. IN AAAA)
    DefaultDnsRawRecord(removed.by.me.com. 3600 IN SOA 50B)
    DefaultDnsRawRecord(OPT flags:0 udp:4000 0B)
2019-01-18 03:50:59,634-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] DEBUG - [id: 0x60682291] WRITE: [18300: /10.102.5.109:53], DefaultDnsQuestion(host.removed.by.me.com. IN CNAME)
2019-01-18 03:51:27,730-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] DEBUG - [id: 0x60682291] RECEIVED: [18300: /10.102.5.109:53], DatagramDnsResponse(from: /10.102.5.109:53, to: /0.0.0.0:58781, 18300, QUERY(0), NoError(0), RD AA RA)
    DefaultDnsQuestion(host.removed.by.me.com. IN CNAME)
    DefaultDnsRawRecord(removed.by.me.com. 3600 IN SOA 50B)
    DefaultDnsRawRecord(OPT flags:0 udp:4000 0B)

Netty 抛出异常:

2019-01-18 03:51:27,730-0600 [toe=01fl3wysf7tfpl] [redisson-netty-1-14] ERROR - failed to resolve 'host.removed.by.me.com' after 3 queries java.net.UnknownHostException: failed to resolve 'host.removed.by.me.com' after 3 queries 
    at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:845) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:806) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:333) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:322) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:779) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsResolveContext.access0(DnsResolveContext.java:62) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsResolveContext.operationComplete(DnsResolveContext.java:382) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsQueryContext.setSuccess(DnsQueryContext.java:192) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:184) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:1127) [netty-resolver-dns-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [netty-codec-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:93) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458) [netty-transport-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor.run(SingleThreadEventExecutor.java:897) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.1.30.Final.jar:4.1.30.Final]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_60]

为什么 netty 会记录以下警告消息? :

Received a DNS response with an unknown ID

有什么原因 netty 没有 accept/read 名称服务器对主机的响应?有什么配置可以让 netty 读取吗?

这是 netty 的问题 - https://github.com/netty/netty/issues/8261

Redisson 3.10.1 应用解决此问题的补丁