When I try to ping my apache2 server (running on Ubuntu Server 16.04) with its domain name, it succeeds from any computer.
However, if I try to access it with a browser, or use ssh, the server is not found. Curling doesn't even give an error message, even if I wait a while.
I have a static ip set behind a router. When I curl localhost I get the expected result. When I curl or ping any website other than the server itself I get the expected result.
This problem appeared after adding dns servers to the network configuration file. However, removing that line does not fix the issue, even after multiple reboots.
Edit: I checked that the correct ports were open on the router, the firewall, and used netstat to check that apache was listening on the correct ports.