1

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)

4
  • Since you say connecting directly by IP address works, it is some problem with the DNS resolution. Either it is your local dns resolver (do you get any results if you check directly at a public resolver, e.g. what does 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?
    – gepa
    Commented Mar 3, 2023 at 11:39
  • Thanks for your answer. Noip shows that my hostname is indeed active, here is a screenshot of the entry: link When I check using nslookup.io, I see that my wan ip is returned. And I receive the following with dig @wan.ip mydoamin.ddns.net: (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)
    – florianbo
    Commented Mar 3, 2023 at 12:39
  • OK, this means ddns is fine, and the issue is in your local system from which you are trying to ssh. What system are you running, and can you share any dns configuration you have, or something that you changed a week ago, when it stopped working. Also, instead of answering in the comments, it is better to edit your question with the additional information. That helps everybody understand your issue better, and possibly find a way to help.
    – gepa
    Commented Mar 3, 2023 at 12:49
  • Thanks again! I edited my post with the additional infos. I tried to ssh from 3 different machines (pop!os, mac and an android phone, which all used to work before) and ended with the same results. I did not setup any particular dns in the machines. And the only modification I made since last week is a few regular updates.
    – florianbo
    Commented Mar 3, 2023 at 13:13

1 Answer 1

0

It definitely looks like a DNS resolution issue. It might come from two places:

  • Your local resolver (e.g. systemd-resolved)
  • Your provider DNS

In the first case, you might try to restart the service and see if this helps (sometimes systemd-resolved is not happy with very low DNS TTLs):

sudo systemctl restart systemd-resolved.service

For the second case, this can be verified using dig. If you set dig to use a public DNS resolver (e.g. Google DNS 8.8.8.8) and it returns an answer (and not NXDOMAIN as in your comment), you can assume that your provider's DNS resolver is at fault.

For example, if I wanted to check test.ddns.net with the public DNS resolver 8.8.8.8, I could use:

dig @8.8.8.8 test.ddns.net

; <<>> DiG 9.16.33-RH <<>> @8.8.8.8 test.ddns.net
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 12144
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;test.ddns.net.         IN  A

;; ANSWER SECTION:
test.ddns.net.      60  IN  A   109.162.33.40

;; Query time: 20 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Fri Mar 03 16:13:41 CET 2023
;; MSG SIZE  rcvd: 58

In this case, it is important to note that:

  • The status is: NOERROR
  • I received an answer in the ANSWER SECTION that corresponds to the A record that I'm querying

If your provider's DNS is at fault, then you need to - at least temporarily - change your system DNS from systemd-resolved to a public one. Something like this might help.

2
  • Thanks for your reply. I tryed both suggestion to no avail. Restart systemd-resolved did not make any change. And using dig with google DNS returns the proper IP. I edited my question with these new info
    – florianbo
    Commented Mar 3, 2023 at 16:01
  • So, in this case, you might want to change your DNS resolver from the one that is provided by your provider and set 8.8.8.8 instead. how2shout.com/linux/… might help.
    – npochet
    Commented Mar 3, 2023 at 16:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .