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

subDomains working as not expected from docs #16

Open
Rubikoid opened this issue Aug 2, 2024 · 1 comment
Open

subDomains working as not expected from docs #16

Rubikoid opened this issue Aug 2, 2024 · 1 comment

Comments

@Rubikoid
Copy link

Rubikoid commented Aug 2, 2024

According to subDomains -> matches table at docs, I thought the next configuration

(
  let
    rootZone = "example.org";
  in
  {
    networking.domains = {
      enable = true;
      defaultTTL = 86400; # 24h
      baseDomains."nodes.${rootZone}" = { };
      baseDomains."${rootZone}" = { };
      subDomains."xxx.nodes.${rootZone}".a.data = [ "1.1.1.1" ];
      subDomains."yyy.${rootZone}".cname.data = [ "xxx.nodes.${rootZone}" ];
    };
  }
)

will evaluate to something like that

{
  "nodes.example.org" = {
    "xxx.nodes.example.org" = {
      a = {
        data = [ "1.1.1.1" ];
        ttl = 86400;
      };
    };
  };
  "example.org" = {
    "yyy.example.org" = {
      cname = {
        data = [ "xxx.nodes.example.org" ];
        ttl = 86400;
      };
    };
  };
}

But in real on the latest master this evaluates to:

{
  "example.org" = {
    "xxx.nodes.example.org" = {
      a = {
        data = [ "1.1.1.1" ];
        ttl = 86400;
      };
    };
    "yyy.example.org" = {
      cname = {
        data = [ "xxx.nodes.example.org" ];
        ttl = 86400;
      };
    };
  };
}

So, the baseDomains."nodes.${rootZone}" = { }; line makes no changes whenever it exists or not.

As how Im traced, this happens due to reducedBaseDomains.
Is this intended?

Also there is an error in code block before table, networking.domains.baseDomains should be replaced with networking.domains.subDomains, otherwise this sample makes no sense.

@Janik-Haag
Copy link
Owner

I'll look into this in a bit once I have more time, thank you very much for the report, but yes you are right, this seems like a bug.

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

No branches or pull requests

2 participants