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

Unqualified domain names #33

Merged
merged 9 commits into from
Dec 11, 2024

Conversation

pigam
Copy link
Contributor

@pigam pigam commented Jul 5, 2024

This adds a useOrigin option to zone type. It is a boolean, equals to false by default.
By default, it changes nothing to the actual result of toString.

If set to true, this change the toString behaviour to add $ORIGIN directive, and use @ as domain name for the zone itself.
writeRecord has been patched accordingly if called with @ as zone name.

This should address #17

I had the need for a RPZ zone.

@felbinger
Copy link

I also need to implement a response policy zone, can this be merged?

Copy link
Contributor

@Tom-Hubrecht Tom-Hubrecht left a comment

Choose a reason for hiding this comment

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

A sentence or two regarding this new behaviour should be addded to the README as documentation

dns/types/record.nix Outdated Show resolved Hide resolved
dns/types/record.nix Outdated Show resolved Hide resolved
dns/types/record.nix Outdated Show resolved Hide resolved
pigam and others added 4 commits December 10, 2024 17:39
Co-authored-by: Tom Hubrecht <Tom-Hubrecht@users.noreply.github.com>
Co-authored-by: Tom Hubrecht <Tom-Hubrecht@users.noreply.github.com>
Co-authored-by: Tom Hubrecht <Tom-Hubrecht@users.noreply.github.com>
@pigam
Copy link
Contributor Author

pigam commented Dec 11, 2024

A sentence or two regarding this new behaviour should be addded to the README as documentation

I moved example.com.nix and wrote an example of a call to toString, see commit f084caf

=========

Then use toString to generate as a string.

{ dns }:

  zoneAsString = dns.lib.toString "example.com" (import ./example.com.nix) { inherit dns; };

If useOrigin=false, the default value, serialization will use fully qualified name.
For instance, A = [ "203.0.113.1" ]will be serialized as example.com. A 203.0.113.1.

If useOrigin=true, toString adds $ORIGIN example.com. and use @ as domain name.
A = [ "203.0.113.1" ]will be then serialized as

$ORIGIN example.com.
@ A 203.0.113.1

@Tom-Hubrecht Tom-Hubrecht merged commit 025996a into nix-community:master Dec 11, 2024
@griffi-gh griffi-gh mentioned this pull request Dec 11, 2024
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.

3 participants