Ubuntu 服务器发送过多的出站请求。我不确定为什么会发生这种情况。
以下是我得到的 tcpdump 输出
root@demotrt:~# tcpdump -n -n port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
04:41:30.345235 IP 45.33.119.111.56543 > 198.58.107.5.53: 56299+ A? jorgee3.pokemoninc.com.members.linode.com. (59)
04:41:30.345493 IP 198.58.107.5.53 > 45.33.119.111.56543: 56299 NXDomain* 0/0/0 (59)
04:41:30.345557 IP 45.33.119.111.46290 > 198.58.107.5.53: 56300+ A? jorgee3.pokemoninc.com. (40)
04:41:30.345813 IP 198.58.107.5.53 > 45.33.119.111.46290: 56300 NXDomain 0/1/0 (100)
04:41:30.345873 IP 45.33.119.111.48219 > 198.58.107.5.53: 56301+ A? jorgee3.pokemoninc.com.members.linode.com. (59)
04:41:30.346173 IP 198.58.107.5.53 > 45.33.119.111.48219: 56301 NXDomain* 0/0/0 (59)
04:41:30.346316 IP 45.33.119.111.54934 > 198.58.107.5.53: 56302+ A? jorgee3.pokemoninc.com. (40)
04:41:30.346546 IP 198.58.107.5.53 > 45.33.119.111.54934: 56302 NXDomain 0/1/0 (100)
04:41:30.346601 IP 45.33.119.111.52024 > 198.58.107.5.53: 56303+ A? jorgee3.pokemoninc.com.members.linode.com. (59)
04:41:30.346860 IP 198.58.107.5.53 > 45.33.119.111.52024: 56303 NXDomain* 0/0/0 (59)
04:41:30.346914 IP 45.33.119.111.58311 > 198.58.107.5.53: 56304+ A? jorgee3.pokemoninc.com. (40)
04:41:30.347158 IP 198.58.107.5.53 > 45.33.119.111.58311: 56304 NXDomain 0/1/0 (100)
04
我认为端口 53 有问题。
我注意到的另一个不常见的事情是端口在不断变化。
root@demotrt:~# netstat -apn|grep -w 53
udp 0 0 45.33.119.111:60095 198.58.107.5:53 ESTABLISHED -
root@demotrt:~# netstat -apn|grep -w 53
udp 0 0 45.33.119.111:45498 198.58.107.5:53 ESTABLISHED -
root@demotrt:~# netstat -apn|grep -w 53
udp 0 0 45.33.119.111:44618 198.58.107.5:53 ESTABLISHED -
root@demotrt:~# netstat -apn|grep -w 53
udp 0 0 45.33.119.111:33521 198.58.107.5:53 ESTABLISHED -
我该如何阻止这些请求?我该如何控制出站流量过大?
答案1
这是 DNS 查找。更改 src 端口号没有问题。您应该调查哪个程序执行了此操作,使用
$ sudo lsof -i | grep domain
例如为什么它需要如此频繁地解析 jorgee3.pokemoninc.com.members.linode.com。
如果它应该这样做,您可能应该使用一些 dns 本地缓存恶魔,例如 nscd。