`dmesg` is flooded with `nf_conntrack: table full, dropping packet` and new connections randomly fail.
AdvancedTroubleshootingNetworking, DNS and firewalls
Answer
Likely causes → The connection tracking table is full: high connection rates on a NAT gateway, load balancer or busy host with stateful firewall rules.
Diagnose →
sysctl net.netfilter.nf_conntrack_count net.netfilter.nf_conntrack_max
sudo conntrack -S | head
sudo conntrack -L 2>/dev/null | awk '{print $1, $4}' | sort | uniq -c | sort -rn | head
Fix → Raise the limit: sysctl -w net.netfilter.nf_conntrack_max=1048576 (and nf_conntrack_buckets via module options), shorten timeouts (nf_conntrack_tcp_timeout_time_wait), or exempt high-volume traffic with notrack rules.
Prevent → Alert at 80% of nf_conntrack_max; size for peak.
More on Networking, DNS and firewalls
`curl http://10.0.1.20:8080` returns `curl: (7) Failed to connect to 10.0.1.20 port 8080: Connection refused`.BeginnerThe same request instead hangs and ends with `curl: (28) Failed to connect to 10.0.1.20 port 8080 after 130000 ms: Connection timed out`. How is this different from "refused"?Beginner`ping google.com` fails with `ping: google.com: Temporary failure in name resolution`, but `ping 8.8.8.8` works.Beginner`dig api.internal` works, but the application and `curl` fail with `Could not resolve host: api.internal`.Intermediate`/etc/resolv.conf` changes you made disappear after a reboot or a few minutes.BeginnerDNS lookups take exactly 5 seconds before succeeding.Intermediate