HTTP and HTTPS requests to external domains from the VPS take approximately 15 to 20 seconds to complete, while localhost requests respond instantly.
Symptoms
curl http://127.0.0.1 responds normally
curl https://domain.com takes around 20 seconds
dig queries time out against 127.0.0.53
systemd resolved logs show degraded feature set warnings
Cause
The issue is not related to web services, CPU load, or an attack.
The VPS was using provider DNS servers that became slow or unstable. systemd resolved attempted UDP and TCP fallbacks repeatedly, causing significant delay for every DNS lookup.
Resolution
-
Configure public DNS
Add the following to /etc/systemd/resolved.conf
DNS=1.1.1.1 8.8.8.8
-
Remove provider DNS from netplan
Edit /etc/netplan/50 cloud init.yaml and update the nameservers section to
addresses
1.1.1.1
8.8.8.8
-
Apply configuration
netplan apply
systemctl restart systemd resolved
Verification
Run resolvectl status and confirm that both global and interface DNS servers show only 1.1.1.1 and 8.8.8.8.
The issue was caused by upstream provider DNS instability. After switching to public DNS servers, the latency was completely resolved.
Was this answer helpful?
Görüşünüz bizim için değerli!