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

When a name is not found how can a status of NXDOMAIN be returned to indicate this? #43

Closed
asampal opened this issue May 7, 2021 · 2 comments

Comments

@asampal
Copy link

asampal commented May 7, 2021

It's not clear how a status of NXDOMAIN should be returned (see https://serverfault.com/questions/373629/what-is-the-correct-response-for-a-dns-server-when-a-domain-does-not-exist).

Is this not possible in the current implementation?

@asampal asampal changed the title How can NXDOMAIN be returned? When a name is not found how can a status of NXDOMAIN be returned to indicate this? May 11, 2021
@DerelictDrone
Copy link

Hopefully I'm not too late, but I just tested, you can edit any and all headers of a response before sending it.

So before you send(response), you just need to set response.header.rcode to either 3 or 0x03(both are treated as 3 by javascript it seems) and DiG/DNS queries will report NXDOMAIN.

Any server-side logic on determining when to send/what to do when receiving an NXDOMAIN is up to you though.

Here's a good resource on all of the headers and their options for a DNS response

@asampal
Copy link
Author

asampal commented Aug 11, 2021

Thanks for the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants