Why is my app not resolving .gov domains?

Validated on 18 Nov 2024 • Last edited on 17 Apr 2025

App Platform apps may be slow or unable to resolve .gov domains because the domain administrators have blocked DigitalOcean’s IP addresses. To fix this, you can contact the domain administrator or use a custom DNS resolver.

For example, if you are using the example.gov domain, you can use the following code to set Cloudflare’s DNS server as the resolver in your Node.js application:

resolver.js
const dns = require('dns');

// Set Cloudflare's DNS server
dns.setServers(['1.1.1.1']);

const agent = new https.Agent({
  lookup: (hostname, options, callback) => {
    dns.lookup(hostname, options, callback);
  }
});

// Example usage with axios
axios.get('https://example.com', { httpsAgent: agent })
  .then(response => {})
  .catch(error => {})

We recommend using a custom DNS resolver only to query the .gov sites that have resolution issues. Setting the custom resolver as the default resolver for your app can cause connection issues to DigitalOcean Managed Databases connected to the app.

Why am I receiving 520 status codes from my app?

Your app may have crashed while trying to receive an upload or return a response larger than it has been configured to manage.

Why am I receiving a forbidden error when making changes to my App Platform app?

Your team balance may be past due. Pay your balance to lift restrictions on actions you can take on the platform.

Why does my app not restart when it fails a health check?

If an app’s health check fails, the app currently does not restart. This is because App Platform does not currently support liveness probes. An app only automatically restarts if the app crashes or if its disk or RAM usage exceeds the its limits.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.