错误(networking不可达)parsing

通过我的日志,我刚刚意识到我的服务器的某些部分可能会受到危害,虽然不是绑定9的专家,我不知道要纠正,以防止这种情况:

Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'www.gamasutra.com/A/IN': 2001:4800:7814:0:5008:8553:ff04:b151#53 Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'www.kitchenworksinc.com/A/IN': 2607:f208:302::2d#53 Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'gyogynovenyek-gyogyteak.com/A/IN': 2607:f0d0:1101:16f::6#53 Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'www.kitchenworksinc.com/AAAA/IN': 2607:f208:302::2d#53 Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'www.kitchenworksinc.com/A/IN': 2607:f208:206::2d#53 Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'www.kitchenworksinc.com/AAAA/IN': 2607:f208:206::2d#53 Oct 24 14:16:50 ip151 named[54864]: error (network unreachable) resolving 'gyogynovenyek-gyogyteak.com/AAAA/IN': 2607:f0d0:1101:16f::6#53 Oct 24 14:16:51 ip151 named[54864]: validating @0x7f4e1405ce60: www.gamasutra.com A: no valid signature found Oct 24 14:16:51 ip151 named[54864]: validating @0x7f4e1c5befc0: gamasutra.com SOA: no valid signature found Oct 24 14:16:51 ip151 named[54864]: validating @0x7f4e2008e200: www.gamasutra.com NSEC: no valid signature found Oct 24 14:16:54 ip151 named[54864]: error (network unreachable) resolving 'www.utrinski.mk/A/IN': 2001:678:1::2#53 Oct 24 14:16:54 ip151 named[54864]: error (network unreachable) resolving 'www.utrinski.mk/AAAA/IN': 2001:678:1::2#53 Oct 24 14:16:54 ip151 named[54864]: error (network unreachable) resolving 'www.utrinski.mk/A/IN': 2001:628:453:bb::4#53 Oct 24 14:16:54 ip151 named[54864]: error (network unreachable) resolving 'www.utrinski.mk/AAAA/IN': 2001:628:453:bb::4#53 Oct 24 14:16:54 ip151 named[54864]: error (connection refused) resolving 'www.utrinski.mk/A/IN': 194.149.137.168#53 Oct 24 14:16:54 ip151 named[54864]: error (connection refused) resolving 'www.utrinski.mk/AAAA/IN': 194.149.137.168#53 Oct 24 14:16:59 ip151 named[54864]: validating @0x7f4e241324c0: www.biblioteksforeningen.org AAAA: no valid signature found Oct 24 14:16:59 ip151 named[54864]: validating @0x7f4e0ccf4060: www.biblioteksforeningen.org A: no valid signature found Oct 24 14:16:59 ip151 named[54864]: validating @0x7f4e0ccf4060: biblioteksforeningen.org A: no valid signature found Oct 24 14:17:04 ip151 named[54864]: error (network unreachable) resolving 'dsac.cn/DS/IN': 2001:dc7::1#53 

这似乎是我的服务器垃圾邮件名称parsing从未知的人。 如果我理解正确,我需要做的是build立我的服务器在某种程度上是私人的。

如果我没有使用正确的术语,我深表歉意,我只是试图快速解决这个问题,然后才成为我托pipe的网站的真正问题。

谢谢

更新1: -route§的结果是:

 Destination Next Hop Flag Met Ref Use If [::]/96 [::] !n 1024 0 0 lo 0.0.0.0/96 [::] !n 1024 0 0 lo 2002:x00::/24 [::] !n 1024 0 0 lo 2002:xf00::/24 [::] !n 1024 0 0 lo 2002:x9fe::/32 [::] !n 1024 0 0 lo 2002:xc10::/28 [::] !n 1024 0 0 lo 2002:x0a8::/32 [::] !n 1024 0 0 lo 2002:x000::/19 [::] !n 1024 0 0 lo 3ffe:xfff::/32 [::] !n 1024 0 0 lo [::]/0 [::] !n -1 113233992 lo localhost/128 [::] Un 0 116069755 lo ipxxx.ip-17x-3x-4x.eu/128 [::] Un 0 1 14444 lo ff00::/8 [::] U 256 0 0 ens18 [::]/0 [::] !n -1 113233992 lo 

更新2

我只是简单地修改了named.conf文件,并做了如下修改(文件中清楚地说明了所有内容,我应该首先查看)

 options { listen-on port 53 { any; }; // listen-on-v6 port 53 { // any; // }; 

我评论了最后3行,因为我没有在我的网站上处理任何IP V6。

还修改该行从是到否:

 `/* - If you are building an AUTHORITATIVE DNS server, do NOT enable recursion. - If you are building a RECURSIVE (caching) DNS server, you need to enable recursion. - If your recursive DNS server has a public IP address, you MUST enable access control to limit queries to your legitimate users. Failing to do so will cause your server to become part of large scale DNS amplification attacks. Implementing BCP38 within your network would greatly reduce such attack surface */` recursion no; 

它似乎没有影响我的任何网站。 结果,我的日志现在看起来像这样:

 Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#58400 (www.dunyadinleri.com): query (cache) 'www.dunyadinleri.com/AAAA/IN' denied Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#58400 (www.dunyadinleri.com): query (cache) 'www.dunyadinleri.com/A/IN' denied Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#17750 (ujquery.org): query (cache) 'ujquery.org/A/IN' denied Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#17750 (ujquery.org): query (cache) 'ujquery.org/AAAA/IN' denied Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#58400 (adsl.aruba.it): query (cache) 'adsl.aruba.it/A/IN' denied Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#58400 (adsl.aruba.it): query (cache) 'adsl.aruba.it/AAAA/IN' denied Oct 24 15:10:57 ip151 named[40819]: client 127.0.0.1#58400 (www.microscopy-uk.org.uk): query (cache) 'www.microscopy-uk.org.uk/A/IN' denied 

Oct 24 14:16:50 ip151 named [54864]:error(network unreachable)resolving'www.gamasutra.com/A/IN':2001:4800:7814:0:5008:8553:ff04:b151#53

Oct 24 14:16:50 ip151 named [54864]:error(network unreachable)resolving'www.kitchenworksinc.com/A/IN':2607:f208:302 :: 2d#53

嗯,我看到它只发生来自IPv6源地址的请求。 所以我认为你的服务器正在监听IPv6地址的请求,但无法到达或发送回复( networking不可达 )。 而且我很确定这可能是由于没有默认网关或默认路由而发生的。

所以检查以下,运行:

 route -6 

你应该看到类似的东西

 ::/0 2001:xxxx:xxxx:196::1 UG 1024 8 874 eth0 

如果没有:: / 0路由,那么这是问题(没有默认路由),因此不能发送答复到IPv6查询。

更新:

 Destination Next Hop Flag Met Ref Use If [::]/96 [::] !n 1024 0 0 lo 0.0.0.0/96 [::] !n 1024 0 0 lo 2002:x00::/24 [::] !n 1024 0 0 lo 2002:xf00::/24 [::] !n 1024 0 0 lo 2002:x9fe::/32 [::] !n 1024 0 0 lo 2002:xc10::/28 [::] !n 1024 0 0 lo 2002:x0a8::/32 [::] !n 1024 0 0 lo 2002:x000::/19 [::] !n 1024 0 0 lo 3ffe:xfff::/32 [::] !n 1024 0 0 lo [::]/0 [::] !n -1 113233992 lo localhost/128 [::] Un 0 116069755 lo ipxxx.ip-17x-3x-4x.eu/128 [::] Un 0 1 14444 lo ff00::/8 [::] U 256 0 0 ens18 [::]/0 [::] !n -1 113233992 lo 

那么正如我所说,没有默认路由,因此他们能够达到你,但你不是。 再次如果你不想要这些查询来,你有三个选项

  • 在ip6tables中的53端口
  • 在接口上禁用ipv6地址
  • 从接口中删除ipv6地址

select任何一个选项套件(如你所说的你正在运行一个networking服务器,而不是DNS),否则你会离开你的系统非常脆弱

阻止端口53(DNS)上的传入UDP通信应该为你做的伎俩。
为了不重复已经说过的话,看看为什么一所大学阻止传入的UDPstream量与目的地端口53?

从你的日志我没有看到那么多的stream量。 无论如何,如果你只想为某些客户端提供DNS服务,只要使用命名ACL即可。

有关如何执行此操作的更多信息,请检查此答案:

绑定将无法正常工作,除非允许查询是“任何”