FreeBSD on Oracle Cloud - name resolution

Hi all,

I'm deploying FreeBSD 14.3-RELEASE in Oracle Cloud Infrastructure (OCI). During provisioning, I set the hostname to "web01", but the system can't resolve it internally. Either the full FQDN "web01.web.vcnwp.oraclevcn.com" or the partial FQDN "web01.web" resolves correctly via DNS, but the short name "web01" does not.

OCI assigns the search domain "vcnwp.oraclevcn.com", but the actual DNS record includes a subnet label ("web") between the hostname and domain. So:
  • "web01" expands to "web01.vcnwp.oraclevcn.com" → does not resolve
  • "web01.web" expands to "web01.web.vcnwp.oraclevcn.com" → resolves correctly
Would it be more appropriate to set the hostname as "web01.web" instead of just "web01" to align with OCI’s DNS behavior? I would like to follow the "correct/canonical" approach from the beginning.

Thank you.

root@web01:~ # cat /etc/rc.conf
hostname=web01


root@web01:~ # cat /etc/hosts
::1 localhost localhost.my.domain
127.0.0.1 localhost localhost.my.domain


root@web01:~ # cat /etc/resolv.conf
# Generated by resolvconf
search vcnwp.oraclevcn.com
nameserver 169.254.169.254
 
Upon further investigation, I found that cloud-init is always overwriting rc.conf upon reboot. Thus "hostname" is always set back to UHN.
 
Back
Top