Greetings,
I am facing an unusual issue. When I ping via a local IP address it pings as it should, false if nothing is connected and a number greater than 0 if something is connected. However, when I ping using hostnames I get a response no matter what. For instance, if I ping "zone3" and zone3 is not connected to the network the ping still responds that something is connected.
Any ideas on how to resolve short of using the IP addresses?
PS C:\WINDOWS\system32> ping -a zone3
Ping request could not find host zone3. Please check the name and try again.
PS C:\WINDOWS\system32>
Can you show us how you have configured the ping node please. Also what version of node-red are you using and what version of nodejs? You can get those from the node-red startup log. In fact if you post the startup log that may be useful.
Starting as a systemd service.
30 Mar 21:00:16 - [info]
Welcome to Node-RED
===================
30 Mar 21:00:16 - [info] Node-RED version: v1.2.3
30 Mar 21:00:16 - [info] Node.js version: v10.21.0
30 Mar 21:00:16 - [info] Linux 5.4.72-v7l+ arm LE
30 Mar 21:00:19 - [info] Loading palette nodes
30 Mar 21:00:24 - [info] +-----------------------------------------------------
30 Mar 21:00:24 - [info] | uibuilder initialised:
30 Mar 21:00:24 - [info] | root folder: /home/pi/.node-red/uibuilder
30 Mar 21:00:24 - [info] | version . .: 2.0.8
30 Mar 21:00:24 - [info] | packages . : vue,bootstrap,bootstrap-vue,jquery,socket.io,ejs
30 Mar 21:00:24 - [info] +-----------------------------------------------------
30 Mar 21:00:24 - [info] Dashboard version 2.23.4 started at /ui
30 Mar 21:00:25 - [warn] ------------------------------------------------------
30 Mar 21:00:25 - [warn] [node-red-contrib-sacn-in/sacn_in] Error: Cannot find module 'e131' (line:2)
30 Mar 21:00:25 - [warn] ------------------------------------------------------
30 Mar 21:00:25 - [info] Settings file : /home/pi/.node-red/settings.js
30 Mar 21:00:25 - [info] Context store : 'default' [module=memory]
30 Mar 21:00:25 - [info] User directory : /home/pi/.node-red
30 Mar 21:00:25 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Mar 21:00:25 - [info] Flows file : /home/pi/.node-red/flows_litserver.json
30 Mar 21:00:25 - [info] Server now running at http://127.0.0.1:1880/
30 Mar 21:00:25 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
30 Mar 21:00:25 - [info] Starting flows
30 Mar 21:00:26 - [info] Started flows
30 Mar 21:00:26 - [info] [sqlitedb:6b323ccf.99d464] opened /home/pi/.node-red/sqlite_database_01.db ok
30 Mar 21:00:26 - [info] [mqtt-broker:MQTT Server PI] Connected to broker: mqtt://localhost:1883
You showed the ping earlier from a Windows machine, but the ping node is running on a pi, so you were not running the ping command on the same machine. However, if you put a random host in and get an output that is obviously not right.
I see that you are using an old version of node-red, but worse you are using a long superseded version of nodejs. The latest version of node 10 is 10.24.0, but v10 is itself only a few weeks from end of life. The fact that you have that version indicates that you maybe you did not use the recommended method of installing node-red on the pi. If you upgrade by running the script from that link it may fix the problem. Make sure your backups are up to date before running the script, though it should not affect your flows file.
You should also work out what the sacn node error is all about.
I performed the necessary updates, and cleared the errors you caught.
Starting as a systemd service.
30 Mar 22:12:29 - [info]
Welcome to Node-RED
===================
30 Mar 22:12:29 - [info] Node-RED version: v1.2.9
30 Mar 22:12:29 - [info] Node.js version: v12.22.0
30 Mar 22:12:29 - [info] Linux 5.4.72-v7l+ arm LE
30 Mar 22:12:29 - [info] Loading palette nodes
30 Mar 22:12:31 - [info] +-----------------------------------------------------
30 Mar 22:12:31 - [info] | uibuilder initialised:
30 Mar 22:12:31 - [info] | root folder: /home/pi/.node-red/uibuilder
30 Mar 22:12:31 - [info] | version . .: 2.0.8
30 Mar 22:12:31 - [info] | packages . : vue,bootstrap,bootstrap-vue,jquery,socket.io,ejs
30 Mar 22:12:31 - [info] +-----------------------------------------------------
30 Mar 22:12:31 - [info] Dashboard version 2.28.2 started at /ui
30 Mar 22:12:31 - [info] Settings file : /home/pi/.node-red/settings.js
30 Mar 22:12:31 - [info] Context store : 'default' [module=memory]
30 Mar 22:12:31 - [info] User directory : /home/pi/.node-red
30 Mar 22:12:31 - [warn] Projects disabled : editorTheme.projects.enabled=false
30 Mar 22:12:31 - [info] Flows file : /home/pi/.node-red/flows_litserver.json
30 Mar 22:12:32 - [info] Server now running at http://127.0.0.1:1880/
30 Mar 22:12:32 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
30 Mar 22:12:32 - [info] Starting flows
30 Mar 22:12:32 - [info] Started flows
30 Mar 22:12:32 - [info] [sqlitedb:9c002548.be10b8] opened /home/pi/.node-red/sqlite_database_01.db ok
30 Mar 22:12:32 - [info] [mqtt-broker:MQTT Server PI] Connected to broker: mqtt://localhost:1883
the ping node is still behaving the same.
Also here is shot pinging from the pi terminal
pi@litserver:~ $ ping randomhostt
PING randomhostt (23.221.222.250) 56(84) bytes of data.
64 bytes from a23-221-222-250.deploy.static.akamaitechnologies.com (23.221.222.250): icmp_seq=1 ttl=50 time=64.2 ms
64 bytes from a23-221-222-250.deploy.static.akamaitechnologies.com (23.221.222.250): icmp_seq=2 ttl=50 time=64.5 ms
64 bytes from a23-221-222-250.deploy.static.akamaitechnologies.com (23.221.222.250): icmp_seq=3 ttl=50 time=64.9 ms
64 bytes from a23-221-222-250.deploy.static.akamaitechnologies.com (23.221.222.250): icmp_seq=4 ttl=50 time=64.4 ms
^C
--- randomhostt ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 64.222/64.515/64.904/0.353 ms
since im getting that using terminal, is my issue related to the pi system instead? (I am a little confused as to why it redirects to akamaitechnologiesDOTcom)
but Im looking for how to do it on the pi. I will keep searching. thank you for the diagnosis, this seems reasonable why the ping function is behaving like that. The ping node is functioning "correctly".
Yes. There should be commented out examples. You don't want that ip address though do you?
In fact I only use it when I want to set a static ip address. I am not sure whether you can leave out the ip address, and routers, so it will use dhcp (which is the default) and just set the domain_name_server. A typical example from mine is
something weird happened, after I used the exec node to perform a shutdown using a nodered button I am unable to ping through hostname again through the ping node. pinging works fine through the terminal. I tried resetting my router and restarting node-red service.
ping: zone4: Name or service not known
edit: I fixed it by deleting the ping node and replacing it and deploying