Docker DNS crashes with 'panic: runtime error: invalid memory address or nil pointer dereference'

I’m new to HA and have installed HAOS directly on an x86 machine. The networking side I initiated with DHCP and even with that none of the default ‘web’ integrations wanted to work (Weather, Radio Browser) and any subsequent integrations I add fail if they need to hit external - but I can install them from Github.
I have been able to resolve some of these issues with editing the docker containers to use a ‘real’ nameserver (8.8.8.8) instead of 172.30.32.3, including the homeassistant docker container via terminal - but I’ve been unable to use HACS and some docker containers shut down after failing to authenticate with appropriate values in their configuration section, so I have no ability to give them an updated DNS.
Why are the docker containers trying to use 172.30.32.3, can I change that to always use something else or can I get a DNS service running at that IP?

As far as I can tell I have no DNS issues as per DNS server issues - Home Assistant

ha resolution info 
checks:
- enabled: true
  slug: dns_server_ipv6
- enabled: true
  slug: supervisor_trust
- enabled: true
  slug: docker_config
- enabled: true
  slug: core_security
- enabled: true
  slug: network_interface_ipv4
- enabled: true
  slug: addon_pwned
- enabled: true
  slug: free_space
- enabled: true
  slug: dns_server
- enabled: true
  slug: multiple_data_disks
- enabled: true
  slug: backups
issues: []
suggestions: []
unhealthy: []
unsupported: []

did you try

ha dns options --servers dns://1.1.1.1
ha dns restart

Unfortunately yes, no luck with that either. I retried it again just now, no luck. HACS and other add ons that are trying to resolve DNS records are still failing.

IPv6 disabled ?
No firewall blocking DOH ?

Yep I turned off IPv6 under System > Network, and there’s no fancy firewall on my end :disappointed:

I’ve found the DNS docker container that HAOS runs and the logs indicate it falls over while booting up

cont-init: info: /etc/cont-init.d/corefile.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun coredns (no readiness notification)
s6-rc: info: service legacy-services successfully started
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x17 pc=0xc00057]
goroutine 1 [running]:
gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer.(*span).setTagError(0x136bf00, 0x7, 0x0, 0x7)
	/go/pkg/mod/gopkg.in/!data!dog/[email protected]/ddtrace/tracer/span.go:131 +0x57
[11:16:17] WARNING: Halt DNS plug-in with exit code 2

But I’ve got no idea why, or how to fix that. Any ideas?

If you have ‘advanced ssh and web terminal’ installed’ with protection mode disabled, try

docker pull ghcr.io/home-assistant/amd64-hassio-dns

No change, restarting the DNS results in the same error messages in the log.

There are 3 topic active at the moment that all have the same DNS problems.

Any other ideas what might be causing the homeassistant DNS docker to crash with a segmentation violation?

Bump again… I’m thinking I will need to tear down this server and re-create it if there are no other suggestions.

Did you flash with balena etcher ? Seems to cause a lot of DNS problems lately.

I did - as per the documentation. I have ordered a new disk drive for the machine, when that arrives it sounds like the better approach might be to install something like Proxmox and then run HAOS as a virtual machine within that rather than directly?

It seems using balena etcher to flash HA OS causes DNS issues. Better to use USBImager

https://bztsrc.gitlab.io/usbimager/

in addition to this post, more info here

Thank you Francis & aceindy - it was some how linked to balena etcher. I took a HAOS backup, flashed HAOS again via USBImager (incidentally significantly slower process, but at least it works) and was able to restore without too many issues. No DNS dramas any more! That official documentation should definitely be steering people away from balena etcher.