Die optie is er al, alleen niet via de GUI (Local DNS records) of via de /etc/hosts file.nero355 schreef op zondag 10 januari 2021 @ 18:33:
Het zou mooi zijn als je de TTL van lokale records lekker hoog kan zetten, want die blijven bij de meesten van ons denk ik toch wel altijd hetzelfde, want Static IP of Static DHCP Mapping
@deHakkelaar
Enige kans dat er ooit zo'n optie erbij komt
Alles wat je via de GUI aanmaakt, toevoegt aan de /etc/hosts file, of de domeinen die op de blocklists staan zullen de TTL aannemen geconfigureerd in onderstaande bestandje:
pi@ph5:~ $ cat /etc/dnsmasq.d/01-pihole.conf [..] local-ttl=2 [..]
pi@ph5:~ $ dig +noall +answer @localhost a flurry.com flurry.com. 2 IN A 0.0.0.0
pi@ph5:~ $ dig +noall +answer @localhost a nas nas. 2 IN A 10.0.0.3
Domeinen die moeten worden ge-forward upstream zullen gewoon de TTL aannemen afkomstig van de "authoritative " DNS server(s):
pi@ph5:~ $ dig +noall +answer @localhost soa tweakers.net tweakers.net. 3600 IN SOA tweakdns.nl. dns.tweakers.net. 2020073007 3600 3600 2419200 3600
pi@ph5:~ $ dig +noall +answer @tweakdns.nl a tweakers.net tweakers.net. 60 IN A 213.239.154.30
pi@ph5:~ $ dig +noall +answer @localhost a tweakers.net tweakers.net. 60 IN A 213.239.154.30
Die korte TTL is zoals je mischien al wist gekozen zodat gebruikers meteen reultaat hebben als ze wat wijzigen en de clients niet hoeven te wachten totdat de TTL is verstreken.
Die TTL kan soms zelfs zo hoog ingesteld staan als 12 of 24 uur.
Wil je zelf controle hebben over de TTL van bepaalde records, zul je zelf een bestandje moeten aanmaken in de /etc/dnsmasq.d folder met onderstaande "directive":
pi@ph5:~ $ man dnsmasq [..] --host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-ad‐ dress>][,<TTL>] Add A, AAAA and PTR records to the DNS. This adds one or more names to the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may appear in more than one --host- record and therefore be assigned more than one address. Only the first address creates a PTR record linking the address to the name. This is the same rule as is used reading hosts-files. --host-record options are considered to be read before host-files, so a name appearing there inhibits PTR-record creation if it appears in hosts-file also. Unlike hosts-files, names are not expanded, even when --expand-hosts is in effect. Short and long names may appear in the same --host-record, eg. --host-record=lap‐ top,laptop.thekelleys.org,192.168.0.1,1234::100 If the time-to-live is given, it overrides the default, which is zero or the value of --local-ttl. The value is a positive integer and gives the time-to-live in seconds.
EDIT: foutje SOA lookup ipv NS lookup voor authoritative DSN server(s)
[ Voor 3% gewijzigd door deHakkelaar op 11-01-2021 09:51 ]
There are only 10 types of people in the world: those who understand binary, and those who don't