Affected versions: FreeBSD 12

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Name lookups fail randomly, causing package, API, and service connectivity outages.

Environment & Reproduction

Affected hosts use DHCP and local caching resolvers; run repeated `drill` queries to reproduce timeouts.

Root Cause Analysis

`/etc/resolv.conf` may be overwritten by DHCP hooks, or upstream DNS latency exceeds default retry windows.

Quick Triage

Inspect resolver file and active DNS daemons.

cat /etc/resolv.conf
service local_unbound status
service named status

Step-by-Step Diagnosis

Capture DNS traffic and compare successful vs failed lookups.

drill freebsd.org
tcpdump -ni em0 port 53 -c 50
grep -i resolv /var/log/messages
Illustrative mockup for freebsd-12 — freebsd12-cp002-diagnosis.webp
Testing resolver behavior with drill and tcpdump — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Pin reliable resolvers and prevent accidental overwrite when appropriate.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sysrc ifconfig_em0='DHCP'
chflags schg /etc/resolv.conf
service local_unbound restart
Illustrative mockup for freebsd-12 — freebsd12-cp002-fix.webp
Persisting resolver settings and restarting services — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use `local_unbound` with forward-zone configuration and keep DHCP-managed resolver updates disabled.

Verification & Acceptance Criteria

100 consecutive `drill` calls succeed and dependent services reconnect without retries.

Rollback Plan

Remove immutable flag from resolver file, restore DHCP defaults, and restart networking.

Prevention & Hardening

Alert on resolver timeout rate and maintain at least two upstream DNS servers.

`Host name lookup failure`, `temporary failure in name resolution`, `SERVFAIL` spikes.

Related tutorial: View the step-by-step tutorial for freebsd-12.

View all freebsd-12 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

`resolv.conf(5)`, `drill(1)`, FreeBSD Handbook networking chapter.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.