After extensive search of this forum to no avail, I post my issue here.
I have a small machine running pop!OS 22.04 at home that I use to host a few pages with nginx.
To do so, I have a no-ip domain (mydomain.ddns.net) and a dyndns setup with my router.
Port forwarding is setup on my router for http, https and my ssh port. These ports are open in ufw on the machine.
Everything used to work as intended and I could ssh to my machine from the outside using ssh [email protected] -p sshport
But since one week ssh returns a ssh: Could not resolve hostname mydomain.ddns.net: Name or service not known
(and of course, same issue with nginx).
To troubleshoot, I did the following:
Restart the machine
Check the info on noip.com. Everything seems fine, IP is the one returned by portchecktool.com, hostname is still correct and marked as active (see: screenshot)
Check ports are open on portchecktool.com. Again, all is fine, http, https and ssh port are open.
Try
nslookup mydomain.ddns.net
and it returns the following:
Server: 127.0.0.53
Address: 127.0.0.53#53
** server can't find mydomain.ddns.net: NXDOMAIN
If I ssh using my WAN ip adress (same as the one seen on portchecktool.com) with the following line:
ssh myname@wanip -p sshport
everything works and I can access my machine as I used to (my webpages also show up using the ip address).If I enter my hostname in nslookup.io, I see that my wan ip is found and returned
The command
dig @8.8.8.8 mydoamin.ddns.net
returns the following:
; <<>> DiG 9.10.6 <<>> @8.8.8.8 mydomain.ddns.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54910
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;mydomain.ddns.net. IN A
;; ANSWER SECTION:
mydomain.ddns.net. 60 IN A WAN.IP
;; Query time: 39 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Mar 03 16:54:53 CET 2023
;; MSG SIZE rcvd: 61
- I tried to ssh from 3 different machines (another pop!OS, a mac and an android phone) and ended with the same results. It works with the wan ip but cannot resolve the hostname
- I also have another partition on that machine running Ubuntu 22.04.1, I booted it up to see if the issue was related to my configuration and I ended up with the exact same issue when I try to ssh to it (works with wan IP but cannot resolve hostname)
It seems to me that the issue is somewhere in the ddns not properly redirecting but I cannot find out why it stopped working all of a sudden. The only modifications done are os updates.
What could I do to troubleshoot this more? Any help would be appreciated.
Thank you
Edit:
Thanks to the great comments below. Adding the google DNS resolver (8.8.8.8) solved my issue.
What bothers me a bit now is that my website is not available to machines with "default" configuration. Is there any way to get my hostname back in the automatically provided DNS? (as it used to be I guess)
dig @8.8.8.8 mydomain.ddns.net
give you, or try some online resolver like nslookup.io . If these also give you NXDOMAIN, it means ddns did not really update the record. you write "everything seems fine", but can you post e.g. a screenshot of my.noip.com/dynamic-dns with your entry? Does it say "Active" under the entry?(1 server found) global options: +cmd Got answer: ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 48655 flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1 OPT PSEUDOSECTION: EDNS: version: 0, flags:; udp: 1232 COOKIE: f4d61592bacb5e1f010000006401e94ef8b8411a85020221 (good)