When you system is configured to use DHCP.

$ sysrc -n ifconfig_re0

/etc/resolv.conf file will be regenerated on each system boot via /sbin/dhclient-script.

However one would prefer to use Public DNS Servers instead the ones provided by the DHCP server.

According to dhclient-script man page, we can change the behavior by overeating the add_new_resolv_conf function in /etc/dhclient-enter-hooks file.

$ cat << EOF > /etc/dhclient-enter-hooks
add_new_resolv_conf() {
       return 0

Now we can safely edit /etc/resolv.conf file - all changes will be persistent across system reboots.