GitHub Pages DNS Validation: Unraveling InvalidDNSError for Smoother Deployment Monitoring

Encountering an InvalidDNSError when setting up a custom domain for GitHub Pages can be a frustrating roadblock, especially when public DNS checks (like Google DNS or Cloudflare DNS) indicate everything is correctly configured. This community insight, drawn from a recent GitHub discussion, delves into why this discrepancy occurs and provides a robust, step-by-step resolution runbook to get your custom domain and TLS certificate provisioned successfully. For anyone involved in planning a software project that includes static site hosting on GitHub Pages, understanding these nuances is key to smooth deployments.

Developer monitoring a GitHub Pages deployment status dashboard.
Developer monitoring a GitHub Pages deployment status dashboard.

Why InvalidDNSError Occurs Despite Correct Public DNS

The core of the problem lies in the difference between how public recursive resolvers and GitHub Pages' internal validation workers (and Let's Encrypt ACME verification servers) query your domain's DNS. While public resolvers might return correct A records, GitHub's validation workers query your authoritative nameservers directly from cloud infrastructure datacenters. If these authoritative nameservers exhibit latency, packet drops, or rate-limiting against automated cloud probes, GitHub will mark the domain with InvalidDNSError.

The original poster's specific error message was:

Both siba-tech.ru and its alternate name are improperly configured. Domain's DNS record could not be retrieved. (InvalidDNSError)

Beyond authoritative nameserver behavior, three specific factors often compound this issue:

  • 24-Hour TTL (Time-To-Live): A high TTL (e.g., 86400 seconds) on your records means that if GitHub's DNS worker encounters a single timeout, that negative or empty cache can persist for up to 24 hours, delaying subsequent successful queries.
  • Missing Let's Encrypt CAA Records: During TLS provisioning, Let's Encrypt must authoritatively verify CAA policies. If queries for CAA records to your authoritative nameservers return an empty response or encounter latency, TLS certificate generation will pause.
  • No Domain Verification Challenge Present: Without explicit domain ownership verification, GitHub applies stricter defensive rate limits and validation gates. A missing _github-pages-challenge TXT record can contribute to validation failures.
Visualizing global Anycast DNS resolution for website hosting.
Visualizing global Anycast DNS resolution for website hosting.

Step-by-Step Resolution Runbook for GitHub Pages DNS Validation

To overcome the validation deadlock and ensure your custom domain is properly configured and TLS certificates are issued, follow this four-step runbook. These steps are vital for effective github monitoring dashboard health and deployment stability.

Step 1: Verify Domain Ownership in GitHub Settings

Explicitly verifying domain ownership helps prioritize your DNS validation cycle:

  1. Navigate to your personal account or organization settings: Settings -> Pages -> Verified domains -> Add a domain.
  2. Enter your custom domain.
  3. GitHub will provide a unique TXT verification challenge.
  4. Add this TXT record in your DNS provider (e.g., REG.RU):
    • Type: TXT
    • Name / Host: _github-pages-challenge-YOUR_USERNAME_OR_ORG (or the full subdomain)
    • Value: The hex string provided by GitHub.
  5. Wait 2 minutes, then click Verify in GitHub.

Step 2: Adjust TTL and Add Explicit CAA Records

Optimizing these records can significantly improve validation success rates:

  1. Reduce TTL: Lower the TTL on your A records and the www CNAME record from 86400 down to 300 or 600 seconds. This reduces stale caching during troubleshooting.
  2. Add Let's Encrypt CAA Records: In your DNS management, add two CAA records to explicitly authorize Let's Encrypt:
    • Type: CAA, Name: @, Value: 0 issue "letsencrypt.org"
    • Type: CAA, Name: @, Value: 0 issuewild "letsencrypt.org"

Step 3: Flush the GitHub Pages Internal Validation Cache

GitHub's Pages orchestrator caches previous check results. To force a completely clean authoritative lookup:

  1. Open repository Settings -> Pages.
  2. Temporarily delete the custom domain entry and click Save.
  3. Wait 60 to 90 seconds.
  4. Re-enter your custom domain and click Save.
  5. Keep Enforce HTTPS unchecked initially until TLS provisioning completes.

Step 4: Alternative / Permanent Fix (Delegate DNS to Anycast Nameservers)

If your current authoritative nameservers continue to cause issues, consider delegating your DNS to a global Anycast provider like Cloudflare DNS:

  1. Keep your current registrar but switch the nameserver delegation to the Anycast provider.
  2. In the Anycast DNS panel, add your records:
    • A @ -> 185.199.108.153
    • A @ -> 185.199.109.153
    • A @ -> 185.199.110.153
    • A @ -> 185.199.111.153
    • CNAME www -> siba-tech.github.io (Set proxy status to DNS-only / Grey Cloud so GitHub manages the TLS certificate).

Anycast nameservers offer global low-latency resolution, typically resolving InvalidDNSError immediately on the subsequent check, providing a more robust foundation for your GitHub Pages site.

|

Dashboards, alerts, and review-ready summaries built on your GitHub activity.

 Install GitHub App to Start
Dashboard with engineering activity trends