diff --git a/content/post/2021-01-30-quick-tip-sni-for-internal-domains-with-turris-omnia.md b/content/post/2021-01-30-quick-tip-sni-for-internal-domains-with-turris-omnia.md index 2beb8de..902abd3 100644 --- a/content/post/2021-01-30-quick-tip-sni-for-internal-domains-with-turris-omnia.md +++ b/content/post/2021-01-30-quick-tip-sni-for-internal-domains-with-turris-omnia.md @@ -53,7 +53,6 @@ This is my configuration, which might be different from yours. What's important What I did was to create this file and add: ```lua - local genRR = policy.ANSWER({ [kres.type.A] = { rdata=kres.str2ip('192.168.30.55'), ttl=900 }, }, true) @@ -65,7 +64,7 @@ What does it do? It sets a [query policy](https://knot-resolver.readthedocs.io/e Notice that these statements will *only* work with kresd >= 5.1, but even the legacy TurrisOS 3.x has the latest version, if you are up-to-date with updates. -In particular, when the request is `kres.type.A`, so an A record, it gives back `192.168.30.55` with a [time-to-live](https://en.wikipedia.org/wiki/Time_to_live) of 900 seconds. This means that every request that follows this policy will answer the same IP address. The secont line adds [a new policy rule](https://knot-resolver.readthedocs.io/en/stable/modules-policy.html#policy.add) to the resolver, which means that every subdomain of `internal.example.com` will resolve to 192.168.30.55. +In particular, when the request is `kres.type.A`, so an A record, it gives back `192.168.30.55` with a [time-to-live](https://en.wikipedia.org/wiki/Time_to_live) of 900 seconds. This means that every request that follows this policy will answer the same IP address. The secont line adds [a new policy rule](https://knot-resolver.readthedocs.io/en/stable/modules-policy.html#policy.add) to the resolver, which means that every subdomain of `internal.example.com` will resolve to `192.168.30.55`. Since kresd assumes data in the DNS wire format, as defined in [RFC 1035](https://tools.ietf.org/html/rfc1035), we use a couple of convenience functions (`kres.str2ip` and `todname`) so we can just type our IP addresses or domain names without any trouble. We can also, potentially, specify multiple subdomains to check with the `policy.todnames` function: