Domain does not resolve to public IP

  • Platform information:
    • Hardware: _ 1.5 GHz 64-bit quad-core [ARM Cortex-A72]/4GB/32GB MicroSD_
    • OS: Openhabian [stable]v1.5-640(a3f6e8a)
    • Java Runtime Environment: _Zulu 8.46.0.225-CA-linux_aarch32hf version: 1.8.0_252 _
    • openHAB version: OpenHAB2
  • Issue of the topic: While trying to configure nginx proxy server, I get an error message from the opnhabian config tool.
  • Please post configurations (if applicable):
    • Items configuration related to the issue
    • Sitemap configuration related to the issue
    • Rules code related to the issue
    • Services configuration related to the issue
  • If logs where generated please post these here using code fences:

I’m trying to configure an nginx reverse proxy server, so I can use a reverse proxy to acces my openhab server from WAN. The openhabian-config tool at some point asks for my domainname, or IP. I have configured a ddns using duckdns, and I have set it up correctly on my rpi4. When I ping the domain, I get my public IP returned, which indicates it’s working. However, when I fill in the domain ([mydomain].duckdns.org) in the openhabian-config tool, it tells me this: image
However, when I fill in a random (incorrect) domain, the setup just continues and doesn’t give the error message.
I first thought it was because of my ports (80 and 443) that were closed, so I opened them, but still the same result. I searched the forum mutliple times for a post that describes this same problem, but have not yet found one.
Anyone knows why this is happening? Please help, it’s for my thesis.

This is an example when using a random domain that doesn’t exist: image
As you can see, the setup tool just doesn’t bother and continues, while the domain given (randomdomainthatdoesntexist) isn’t checked.

Another possibility why the script continues without an error message could be that the public IP address that is returned by the script is not correct either - the script only continues without that error message if both values match.

to get the public IP address:

dig +short myip.opendns.com @resolver1.opendns.com |tail -1

to get the public IP address by domain name ( replace test.duckdns.org with your domain ):

dig +short "test.duckdns.org" @resolver1.opendns.com |tail -1
1 Like

I tried the commands you mentioned:

  • dig +short “test.duckdns.org” @resolver1.opendns.com |tail -1 (with my domain), gives me my public IP in return.
  • dig +short myip.opendns.com @resolver1.opendns.com |tail -1 doesn’t return anything, so there’s the problem.
    When I watch the console logs of the openhabian-config tool, I also see that “Obtaining public IP address…” returns blanc.
    Any idea why this is happening? Maybe a mistake in network interfaces file?
    TIA

Found this please try if this command works ( added -4 ):

dig -4 +short myip.opendns.com @resolver1.opendns.com
1 Like

This command returns my public IP.
However, when trying out the setup for reverse proxy in the openhabian-config tool, the public IP address still doesn’t get obtained…image
How can I solve this?

This issue has been resolved! I found the packages.bash file, which is used in the reverse proxy setup, and have edited the command that returns my public IP, so that it actually does return the IP and not blanc.
More info can be found on my post on github; https://github.com/openhab/openhabian/issues/960
Thanks for all the help!

@mstormi,
shouldn’t this be applied to openhabian-config ?
Either fixed with -4 or dynamic depending on if IPv4 or IPv6 address is returned by domain name lookup ? In this way others might not fall into this.

1 Like

worked around in coming openHABian
But note there is a problem with your setup as dig should yield a result even without -4

2 Likes