So I found out I only had a NS
entry but no A
entry for my root subdomain. In order to get it work I needed to add an entry like this
Name | Type | TTL | Information |
---|---|---|---|
local.mydomain.com | A | 86400 | 192.168.0.10 (local IP of my computer) |
However, I also want to point out that it is required to disable DNS Rebind Protection in the Router and iCloud Private Relay on your devices in order to work. I will try if I get this work with my webserver as DNS for those cases but so far I wasn't too successful.
The reason why it was working for www.local.mydomain.com was because I already had an entry like this before which I removed but I suppose was still cached on my device:
Name | Type | TTL | Information |
---|---|---|---|
*.local.mydomain.com | A | 86400 | 192.168.0.10 (local IP of my computer) |
So my device tried both with and without the www
and with the www
it had a success so it appended it.
Setup on Webserver
So I also finally managed to move my DNS setup to my webserver. This way I do not need to disable iCloud Private Relay. My setup looks like this. (I needed to wait for a while before it was synced to my DNS and worked)
Name | Type | TTL | Information |
---|---|---|---|
local.mydomain.com | A | 86400 | 192.168.0.10 (local IP of my computer) |
anothersub.local.mydomain.com | A | 86400 | 192.168.0.10 (local IP of my computer) |
I might possibly manage to replace anothersub.local.mydomain.com
with *.local.mydomain.com
for wildcard subdomains but it is not really required for my use case.