Can't resolve DNS (I think...)

My YunoHost server

Hardware: Raspberry Pi 3 at home
YunoHost version: 11.0.10.2 (stable)
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

Hi everyone,

I’m trying to use a simple custom bash script (that I want to run periodically via cron) and when the script runs I get the following error :

$ sysbus
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 73, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.9/socket.py", line 953, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

From what I read it seems that my raspberryPi can’t resolve the host name.
The sysbus command is called inside my script and simply tries to connect to my internet box (livebox4) in order to retrieve some info.
The purpose of my script is to monitor my public ipv4 address and compare it to the one on my registrar DNS table (@ Gandi) and make the necessary changes if the public ipv4 address changes (it does from time to time, but not regularly…).

I think the name it can’t resolve is http://livebox.home.

So I tested to ping something like ping https://google.com and it gives ping: https://google.com: Name or service not known… which I guess is not normal ?

Furthermore looking at /etc/hosts I see the content is :

127.0.0.1	localhost
::1		localhost ip6-localhost ip6-loopback
ff02::1		ip6-allnodes
ff02::2		ip6-allrouters

127.0.1.1		yunohost

127.0.0.1	mydomain

which I find a bit strange…

Is something wrong with this content knowing that mydomain is my domain name which points to my raspberryPi.

Apart from this I mainly use my yunohost with a Nextcloud and this works perfectly fine, I can access it from an external network without problem, so I know that my internet box is correctly configured for that use. But maybe some configurations are missing for the specific use of a local bash script ?

Also there is something I don’t understand about users.
I can connect via ssh to my raspberry pi with :

  • root >> using the yunohost administrator interface password
  • admin >> yes and it doesn’t asks a password because I configured the ssh connection to use an ssh key (but I thought that this user would correspond to the yunohost administrator)
  • myusername >> which is the only non administrator user, but the yunohost password for this user does not work via ssh, and I suppose it’s normal (?)

I thought I would use the admin user to set up my bash script and cronjob but maybe this is not what I should do ?

There are several different questions here, sorry if it’s not clear, don’t hesitate to tell me to clarify things if needed.

And thanks for any help/hints that will make me better understand all this, I’m not a pro computer programmer !

OK I read the doc (:sweat_smile:) and concerning the users (root/admin/other users) I now understand how it works.

I suppose using the admin user is ok, I also tried with my user (after giving the ssh permission via the admin panel) and the original problem of my post persists.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.