This commit is contained in:
		
					parent
					
						
							
								fceed52226
							
						
					
				
			
			
				commit
				
					
						bd54594c73
					
				
			
		
					 1 changed files with 1 additions and 2 deletions
				
			
		|  | @ -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: | What I did was to create this file and add: | ||||||
| 
 | 
 | ||||||
| ```lua | ```lua | ||||||
| 
 |  | ||||||
| local genRR = policy.ANSWER({ | local genRR = policy.ANSWER({ | ||||||
| [kres.type.A] = { rdata=kres.str2ip('192.168.30.55'), ttl=900 }, | [kres.type.A] = { rdata=kres.str2ip('192.168.30.55'), ttl=900 }, | ||||||
| }, true) | }, 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. | 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: | 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: | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue