Emulate a hosts entry



  • I want to have {hostname} resolve to {internal ip address), but whenever I try this pfsense pings {hostname}.{domain.tld}, which routes it out to my external DNS server and so forth.

    I have a feeling that just editing hosts would achieve what I want, but I'm sure there must be a better way I'm not finding.

    Thanks in advance.



  • use host-overrides in either dnsforwarder or dnsresolver (whatever you are currently using).

    be sure your clients use pfSense as their dns server



  • When you ping $hostname on any current OS, it actually does a DNS lookup for $hostname.$default-domain and uses that result. So you need a DNS override for $hostname.$default-domain, where $default-domain == domain name defined in System>General Setup.



  • Thanks guys.  I thought I had tried that at the time I posted, and that it hadn't worked, but I probably misspelled the domain or something because of course it works fine.


Log in to reply