Query DNS to Determine Apex Domains #134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From https://datatracker.ietf.org/doc/html/rfc7719#section-6 (with emphasis on the last sentence).
Based on the above, I believe that we should consider treating the DNS as the source of truth with regards to determining apex domains. Currently we use the Public Suffix gem's parser to try to determine this, however, it fails in cases.
Taken from
pages-health-check/lib/github-pages-health-check/domain.rb
Lines 172 to 176 in 49e954c
However
techblog.netflix.com
is actually an apex domain!But the current logic doesn't think so:
This PR is an attempt to make
Domain#apex_domain?
true by looking at DNS records to confirm.I have a temporary child zone set up at
child.jr4legacy.com
which is a child ofjr4legacy.com
zone but is also a zone apex. I have set up a temporary Pages site at https://child.jr4legacy.com.When running
check
:Before:
After: