DNS Resolving strange

So, I’m running Fedora 42 KDE. I am trying to get to a Home Assistant server that I run in the house. There is an external DNS configuration for this as well. However, I can’t log in from Chrome on Fedora but it works fine from other system. Then I tried to ping it…
Someone please explain this to me… It resolves with dig, but not a ping.

fritz@FritzPC:~$ dig assist.freund.house

; <<>> DiG 9.18.35 <<>> assist.freund.house
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13863
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;assist.freund.house.           IN      A

;; ANSWER SECTION:
assist.freund.house.    0       IN      A       192.168.20.30

;; Query time: 2 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Thu Apr 24 14:37:15 MDT 2025
;; MSG SIZE  rcvd: 64

fritz@FritzPC:~$ ping assist.freund.house
PING p73vixj5autepul03jkrr7gzcg9bqzvk.ui.nabu.casa (54.227.162.152) 56(84) bytes of data.
^C
--- p73vixj5autepul03jkrr7gzcg9bqzvk.ui.nabu.casa ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 1031ms

That doesn’t really help all that much I don’t think. With dig, it comes back with the correct IP address. However, if I ping the system I get an external IP address instead of the internal address. Because of this my system won’t load the correct page for HA.

If I ping from a windows machine on the same network, it’s fine. Doesn’t have an issue. I can also access the HA no problem from the windows box.

Even a Curl shows that it’s using the wrong IP address…

fritz@FritzPC:~$ curl -v https://assist.freund.house
* Host assist.freund.house:443 was resolved.
* IPv6: (none)
* IPv4: 54.227.162.152
*   Trying 54.227.162.152:443...
* ALPN: curl offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
*  CApath: none
* TLS connect error: error:00000000:lib(0)::reason(0)
* OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to assist.freund.house:443 
* closing connection #0
curl: (35) TLS connect error: error:00000000:lib(0)::reason(0)

If I add the correct IP address to my hosts file, I can access HA just fine. After some research it seems to have something to do with how Fedora is talking to the DNS server on Home Assistant. Like it doesn’t know that it’s coming from a local system so it doesn’t give a local address, it forwards on the request to external DNS.

Check the output:

resolvectl flush-caches
resolvectl reset-server-features
resolvectl query assist.freund.house
resolvectl status --no-pager
grep -e ^hosts: /etc/nsswitch.conf
grep -v -e ^# -e ^$ /etc/resolv.conf

It’s possible your ISP doesn’t play well with systemd-resolved. Mine doesn’t. Try setting it to 1.1.1.1 and see if you still have issues.