Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only return ServFail if answers & authority are empty #262

Merged
merged 1 commit into from Sep 23, 2023

Conversation

barrucadu
Copy link
Owner

There are two cases when the answers can be empty:

  • NXDOMAIN - the server is authoritative for this zone and the domain does not exist.
  • NODATA - the server is authoritative for this zone, the domain exists, but there's no record of the requested type. This commit fixes this case.

In both of these cases, the SOA record should be returned in the authority section. So, change the ServFail case to only return an error if there are no authority records, as that could indicate a failure talking to upstream nameservers.

Additionally, NODATA should be returned if the server is non-authoritative for this domain and the authoritative server returns NXDOMAIN or NODATA. Changes will be required to the recursive and forwarding resolvers (to pass along the relevant SOA record) to support this case

There are two cases when the answers can be empty:

- `NXDOMAIN` - the server is authoritative for this zone and the domain
does not exist.
- `NODATA` - the server is authoritative for this zone, the domain
exists, but there's no record of the requested type.  This commit fixes
this case.

In both of these cases, the SOA record should be returned in the
authority section.  So, change the `ServFail` case to only return an
error if there are no authority records, as that could indicate a
failure talking to upstream nameservers.

Additionally, `NODATA` should be returned if the server is
non-authoritative for this domain and the authoritative server returns
`NXDOMAIN` or `NODATA`.  Changes will be required to the recursive and
forwarding resolvers (to pass along the relevant SOA record) to support
this case
@barrucadu barrucadu merged commit a5e5262 into master Sep 23, 2023
3 checks passed
@barrucadu barrucadu deleted the fix-authoritative-nodata branch September 23, 2023 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant