You can find a good explanation about how dns work on wikippedia.
As a simplification, you can look at it like an inverse file system. To discover the IP address for mydomain.net a computer will work in a similar way that to find a file on /net/mydomain. First it must read the root dir to find where id the net dir, in dns land it will have to ask the root servers for .net. Then it will read the net dir to search for mydomain, in dns land it will ask the.net server for mydomain.
Note that this was not a technically correct answer. Filesystems don't work that way, DNS caching and multiple DNS makes name resolving more complicated. But I feel that it is a simple model.
Back to your problem: the .net root dns are saying that the authoritative dns for your domain are dns1.stabletransit.com. and dns2.stabletransit.com.. So when a computer is triying to resolve test.mydomain.net it will ask dns1.stabletransit.com for the test.mydoin.net IP, not your server, and stabletransit doesn't know anything about test.
You have two options:
1) The sensible and easy one. Forget about running your dns server and just add test.mydomain.net to dns1.stabletransit.com. There is likely some option to do it where you bougth the domain.
2) The geek way, great for learning. Delegate your dns to your own server, learn all about dns, find some secondaries (your ISP will likely do it) and have fun. You will have to read quite a lot of documentation and experiment a little. Be sure that you are able to access your domain by IP, you will need it when (not if) something goes wrong.
i did what @jringoot suggested in his comment:
mv /etc/resolv.conf /etc/resolv.conf_orig
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
which basically copies the original resolv.conf file and creates another one.
I examined it and it showed it was still using router dns.
so then I opened the file
vim /etc/resolv.conf
and edited the nameserver from the router dns to 1.1.1.1 (CloudFlare DNS)
i.e. fill it with:
nameserver 1.1.1.1
when i do a check using
nslookup google.com
it now shows it is using my specified DNS:
nslookup google.com
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
Name: google.com
Address: 172.217.160.14
Best Answer
Turns out it's a difference between the way chrome/firefox fetch names and the way dig/host fetch names.
Typical
nsswitch.conf
has this line:Which should be changed to:
and then everything will magically work.