π ~1 min read
Table of contents
Symptom & Impact
Host cannot resolve domain names, breaking package fetch and service integrations.
Environment & Reproduction
Appears after DHCP changes or manual edits overwritten at boot.
cat /etc/resolv.conf
host pkg.FreeBSD.org
pkg update
Root Cause Analysis
Incorrect nameserver entries or conflicting resolver ownership causes failed lookups.
Quick Triage
Test direct resolver reachability and query behavior.
drill pkg.FreeBSD.org
ping -c 3 1.1.1.1
cat /etc/resolv.conf
Step-by-Step Diagnosis
Confirm whether DHCP client or local policy rewrites resolv.conf incorrectly.
grep -i resolv /var/log/messages | tail -n 40
cat /etc/dhclient.conf 2>/dev/null || true
service netif restart
cat /etc/resolv.conf

Solution – Primary Fix
Set stable DNS servers and preserve resolver config according to policy.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
cat > /etc/resolv.conf <<'EOF'
nameserver 1.1.1.1
nameserver 8.8.8.8
search localdomain
EOF
chflags schg /etc/resolv.conf

Solution – Alternative Approaches
Configure dhclient supersede directives instead of immutable resolv.conf.
echo 'supersede domain-name-servers 1.1.1.1, 8.8.8.8;' >> /etc/dhclient.conf
service netif restart
Verification & Acceptance Criteria
Domain resolution works consistently and package updates complete.
drill freebsd.org
pkg update
fetch -qo /dev/null https://www.freebsd.org
Rollback Plan
Remove immutable flag and revert to DHCP-managed resolver if required.
chflags noschg /etc/resolv.conf
service netif restart
Prevention & Hardening
Document resolver ownership model and monitor DNS failures in system logs.
grep -iE 'resolver|dns|host not found' /var/log/messages | tail -n 50
Related Errors & Cross-Refs
Related to default route loss, pf outbound blocks, and upstream resolver outages.
Related tutorial: View the step-by-step tutorial for FreeBSD 15.
View all FreeBSD 15 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
FreeBSD resolver and dhclient documentation.
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.