Skip to content

Commit

Permalink
Also pass the record class to nsupdate when deleting a record
Browse files Browse the repository at this point in the history
This makes deleting a record more consistent with adding it.
  • Loading branch information
Luflosi committed Mar 26, 2024
1 parent 9630204 commit 17d8205
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions example-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ stdin_per_zone_update = "send\n"
final_stdin = "quit\n"

[update_program.ipv4]
stdin = "update delete {domain}. A\nupdate add {domain}. {ttl} IN A {ipv4}\n"
stdin = "update delete {domain}. IN A\nupdate add {domain}. {ttl} IN A {ipv4}\n"

[update_program.ipv6]
stdin = "update delete {domain}. AAAA\nupdate add {domain}. {ttl} IN AAAA {ipv6}\n"
stdin = "update delete {domain}. IN AAAA\nupdate add {domain}. {ttl} IN AAAA {ipv6}\n"

[users.alice]
# 123456
Expand Down
4 changes: 2 additions & 2 deletions nix/e2e-test.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ self:
args = [ "-k" "/run/named/ddns.key" ];
stdin_per_zone_update = "send\n";
final_stdin = "quit\n";
ipv4.stdin = "update delete {domain}. A\nupdate add {domain}. {ttl} IN A {ipv4}\n";
ipv6.stdin = "update delete {domain}. AAAA\nupdate add {domain}. {ttl} IN AAAA {ipv6}\n";
ipv4.stdin = "update delete {domain}. IN A\nupdate add {domain}. {ttl} IN A {ipv4}\n";
ipv6.stdin = "update delete {domain}. IN AAAA\nupdate add {domain}. {ttl} IN AAAA {ipv6}\n";
};
users = {
alice = {
Expand Down
4 changes: 2 additions & 2 deletions nix/module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ in
stdin = lib.mkOption {
type = lib.types.str;
default = "";
example = "update delete {domain}. A\nupdate add {domain}. {ttl} IN A {ipv4}\n";
example = "update delete {domain}. IN A\nupdate add {domain}. {ttl} IN A {ipv4}\n";
description = lib.mdDoc ''
String template to send to the stdin of the update program for updating the IPv4 DNS record.
The three different variables are replaced with the appropriate values before the string is sent to the update program.
Expand All @@ -152,7 +152,7 @@ in
stdin = lib.mkOption {
type = lib.types.str;
default = "";
example = "update delete {domain}. AAAA\nupdate add {domain}. {ttl} IN AAAA {ipv6}\n";
example = "update delete {domain}. IN AAAA\nupdate add {domain}. {ttl} IN AAAA {ipv6}\n";
description = lib.mdDoc ''
String template to send to the stdin of the update program for updating the IPv6 DNS record.
The three different variables are replaced with the appropriate values before the string is sent to the update program.
Expand Down

0 comments on commit 17d8205

Please sign in to comment.