If your VPS can reach external IP addresses but cannot reliably resolve domain names, the issue may be related to DNS configuration, resolver availability, firewall rules, or an overloaded local DNS service.
Follow these steps:
Check the configured DNS servers:
cat /etc/resolv.conf
Test DNS resolution:
dig google.com
Query a specific DNS resolver:
dig @1.1.1.1 google.com
Check whether the local resolver is running:
systemctl status systemd-resolved
Inspect DNS-related firewall rules and check whether UDP and TCP port 53 traffic is being blocked.
Review resolver logs for timeout or connection errors.
If direct DNS queries work but normal lookups fail, investigate the local resolver configuration.
Avoid replacing /etc/resolv.conf blindly. Some Linux distributions manage this file automatically, and manual changes may disappear after a reboot.