Skip to content

Added support for DNS cookies (RFC 7873/9018, and partially BCP 38) - #56

Open
zbalkan wants to merge 5 commits into
TechnitiumSoftware:masterfrom
zbalkan:feat/add-dns-cookie-support
Open

Added support for DNS cookies (RFC 7873/9018, and partially BCP 38)#56
zbalkan wants to merge 5 commits into
TechnitiumSoftware:masterfrom
zbalkan:feat/add-dns-cookie-support

Conversation

@zbalkan

@zbalkan zbalkan commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Adds DNS Cookies support across TechnitiumLibrary EDNS(0) COOKIE parsing, server-side cookie generation/validation, and request/response handling per RFC 7873/9018.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds DNS Cookie support to the TechnitiumLibrary DNS implementation per RFC 7873/9018. It introduces a new EDnsCookieOptionData class to handle EDNS(0) COOKIE parsing and validation, and updates the EDnsOption class to support null option data and handle COOKIE options during serialization/deserialization.

Changes:

  • Added EDnsCookieOptionData class for RFC 7873 DNS Cookie support with client (8 bytes) and optional server cookies (8-32 bytes)
  • Updated EDnsOption to handle COOKIE option code parsing and null data scenarios
  • Modified EDnsOption.WriteTo() and SerializeTo() to support EDNS options with zero-length data

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsOption.cs Added COOKIE case in parsing switch, null data handling in WriteTo/SerializeTo, and nullable UncompressedLength calculation
TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsCookieOptionData.cs New sealed class implementing DNS Cookie EDNS option with validation, serialization, and equality support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsOption.cs
Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsOption.cs Outdated
Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsCookieOptionData.cs Outdated
Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsCookieOptionData.cs Outdated
Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsCookieOptionData.cs Outdated
Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsCookieOptionData.cs Outdated
Comment thread TechnitiumLibrary.Net/Dns/EDnsOptions/EDnsCookieOptionData.cs Outdated
@zbalkan

zbalkan commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

Okay, Copilot has some valid suggestions. I'll fix them tomorrow.

@zbalkan
zbalkan force-pushed the feat/add-dns-cookie-support branch from e22a263 to 936fb6c Compare August 24, 2026 18:53
@zbalkan

zbalkan commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest master.

@zbalkan
zbalkan force-pushed the feat/add-dns-cookie-support branch from 083c760 to 0680193 Compare August 24, 2026 19:42
@zbalkan zbalkan changed the title Added basic support for DNS cookies Added support for DNS cookies (RFC 7873/9018, and partially BCP 38) Aug 26, 2026
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.

2 participants