HassOS Hostname can't resolve

Hi all,

I’ve been using my Home Assistant on Pi4 for quite sometime, I noticed that the hostname is always show error that it can’t be resolve,
I tried to manually add it into hosts file, but it resets on every reboot.

docker exec -it homeassistant bash
vi /etc/hosts

One of the use case for HA is Adguard home and it works perfectly with hostname and ssl configured too.

Can anyone point me into a good direction where should I look at to permanently add the hostname?

My Raspberry Pi 4 8 GB Home assistant environment:

System Health

version: core-2022.4.0
installation_type: Home Assistant OS
dev: false
hassio: true
docker: true
user: root
virtualenv: false
python_version: 3.9.9
os_name: Linux
os_version: 5.10.103-v8
arch: aarch64
timezone: Asia/Singapore


GitHub API: ok
Github API Calls Remaining: 5000
Installed Version: 1.13.2
Stage: running
Available Repositories: 1007
Installed Repositories: 7


logged_in: false
can_reach_cert_server: ok
can_reach_cloud_auth: ok
can_reach_cloud: ok


host_os: Home Assistant OS 7.6
update_channel: stable
supervisor_version: supervisor-2022.03.5
docker_version: 20.10.9
disk_total: 58.0 GB
disk_used: 9.4 GB
healthy: true
supported: true
board: rpi4-64
supervisor_api: ok
version_api: ok
installed_addons: Samba share (9.5.1), SSH & Web Terminal (10.1.1), AdGuard Home (4.5.0), MariaDB (2.4.0), Let's Encrypt (4.12.0), ArgonOne Active Cooling (24.1), File editor (5.3.3), Home Assistant Google Drive Backup (0.105.2), Z-Wave JS (0.1.55)


dashboards: 1
resources: 5
views: 3
mode: storage

Finally after trying so many ways, simply running the below code actually works!

ha dns options --servers dns://DNS_SERVER_IP