pfsense:dns:troubleshooting:slow_dns_response
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
pfsense:dns:troubleshooting:slow_dns_response [2021/01/31 16:01] – created peter | pfsense:dns:troubleshooting:slow_dns_response [2021/02/01 09:24] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PFSense - DNS - Troubleshooting - Slow DNS Response ====== | ====== PFSense - DNS - Troubleshooting - Slow DNS Response ====== | ||
+ | |||
+ | Various things to check. | ||
+ | |||
+ | <WRAP info> | ||
+ | **CONCLUSION: | ||
+ | |||
+ | Ideally, Unbound should not restart but simply needs to refresh. | ||
+ | |||
+ | If pfBlockerNG is being used, this could mean upwards of 60 seconds of downtime whilst it reloads any blocklists. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Change Firewall Maximum Table Entries ===== | ||
+ | |||
+ | Navigate to **System -> Advanced > Firewall & Nat**: | ||
+ | |||
+ | * Firewall Maximum Table Entries: | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | The higher this value, the more memory it will use, so be careful setting this too high on systems with low memory. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Monitor the Status ===== | ||
+ | |||
+ | Navigate to **Status -> Monitoring**. | ||
+ | |||
+ | * Click the **Settings** Icon. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | * Left Axis: **Quality**. | ||
+ | * Right Axis: **None**. | ||
+ | * Click **Update Graphs**. | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | </ | ||
+ | |||
+ | |||
+ | {{: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | Check if there is any recent slowness being reported: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ---- | ||
+ | ===== Check what interfaces are running ===== | ||
+ | |||
+ | Navigate to **Diagnostics -> Command Prompt**. | ||
+ | |||
+ | <code bash> | ||
+ | pciconf -lv | grep -A1 -B3 network | ||
+ | </ | ||
+ | |||
+ | returns: | ||
+ | |||
+ | <code bash> | ||
+ | em0@pci0: | ||
+ | vendor | ||
+ | device | ||
+ | class = network | ||
+ | subclass | ||
+ | em1@pci0: | ||
+ | vendor | ||
+ | device | ||
+ | class = network | ||
+ | subclass | ||
+ | em2@pci0: | ||
+ | vendor | ||
+ | device | ||
+ | class = network | ||
+ | subclass | ||
+ | em3@pci0: | ||
+ | vendor | ||
+ | device | ||
+ | class = network | ||
+ | subclass | ||
+ | em4@pci0: | ||
+ | vendor | ||
+ | device | ||
+ | class = network | ||
+ | subclass | ||
+ | em5@pci0: | ||
+ | vendor | ||
+ | device | ||
+ | class = network | ||
+ | subclass | ||
+ | </ | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | Intel usually works well with pfSense. | ||
+ | |||
+ | If on the otherhand this was not Intel, this could be a cause for the slowness. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Check DNS Resolver Caching Figures ===== | ||
+ | |||
+ | Navigate to **Diagnostics -> Command Prompt**. | ||
<code bash> | <code bash> | ||
Line 8: | Line 124: | ||
<code bash> | <code bash> | ||
- | total.num.queries=1297 | + | total.num.queries=11060 |
total.num.queries_ip_ratelimited=0 | total.num.queries_ip_ratelimited=0 | ||
- | total.num.cachehits=1026 | + | total.num.cachehits=10669 |
- | total.num.cachemiss=271 | + | total.num.cachemiss=391 |
- | total.num.prefetch=96 | + | total.num.prefetch=342 |
- | total.num.expired=88 | + | total.num.expired=295 |
- | total.num.recursivereplies=271 | + | total.num.recursivereplies=438 |
- | msg.cache.count=1552 | + | msg.cache.count=2073 |
- | rrset.cache.count=3277 | + | rrset.cache.count=4222 |
- | infra.cache.count=3255 | + | infra.cache.count=6734 |
- | key.cache.count=132 | + | key.cache.count=174 |
</ | </ | ||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | * unbound-control -c / | ||
+ | * unbound-control -c / | ||
+ | |||
+ | |||
+ | Output is: | ||
+ | |||
+ | * **num.queries**: | ||
+ | * **num.cachehits**: | ||
+ | * **num.cachemiss**: | ||
+ | * **num.prefetch**: | ||
+ | * This number is included in cachehits, as the original query had the unprefetched answer from cache, and resulted in recursive processing, taking a slot in the requestlist. | ||
+ | * Not part of the recursivereplies (or the histogram thereof) or cachemiss, as a cache response was sent. | ||
+ | * **num.zero_ttl**: | ||
+ | * **num.recursivereplies**: | ||
+ | * Could be smaller than **threadX.num.cachemiss** if due to timeouts no replies were sent for some queries. | ||
+ | * **msg.cache.count**: | ||
+ | * **rrset.cache.count**: | ||
+ | * **infra.cache.count**: | ||
+ | * These are IP addresses with their timing and protocol support information. | ||
+ | * **key.cache.count**: | ||
+ | * These are DNSSEC keys, one item per delegation point, and their validation status. | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Check System Logs for the DNS Resolver ===== | ||
+ | |||
+ | Navigate to **Status -> System Logs -> System -> DNS Resolver**. | ||
+ | |||
+ | Check if the DNS Resolver is restarting when this issue occurs. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | <WRAP info> | ||
+ | **NOTE: | ||
+ | |||
+ | See: https:// | ||
+ | |||
+ | It seems that Unbound restarts when the WAN DHCP lease gets renewed. | ||
+ | |||
+ | * Compare the DNS and DHCP logs will probably show there is a correlation. | ||
+ | * Every time a Remote Client connection is initiated or stopped, Unbound has to restart. | ||
+ | * The DHCP code is currently sending a HUP signal to the DNS Resolver, which Unbound takes as needing to do a restart. | ||
+ | * Ideally, when a new host enters the DNS local zone because it gets a DHCP release the correct thing to do is reload that zone, not restart the DNS service. | ||
+ | * If pfBlockerNG is being used, this could mean upwards of 60 seconds of downtime whilst it reloads any blocklists. | ||
+ | |||
+ | A temporary workaround is not to use DHCP. | ||
+ | |||
+ | * For every DHCP entry, you could set and maintain, at the bottom of the page, the **DHCP Static Mappings for this Interface**. | ||
+ | * On the **Status -> DHCP Leases** page you can also choose what lease you want to add as a Static lease. | ||
+ | |||
+ | Other options to try: | ||
+ | |||
+ | * Reduce the number of pfBlockerNG blocks. | ||
+ | * This should speed up the restart of Unbound. | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== References ===== | ||
+ | |||
+ | https:// |
pfsense/dns/troubleshooting/slow_dns_response.1612108900.txt.gz · Last modified: 2021/01/31 16:01 by peter