I can access node-RED easily from other devices, but I have a problem: it is common for the router to assign my machine (pc with win 10) from time to time dynamic ip addresses.
When this happens, I have to check the new ip to access node-RED again, a repetitive task that I believe is unnecessary.
I was wondering: wouldn't there be a way to mask the dynamic ip with a local DNS address? I believe that even if the numerical address changes, I can access the application by the DNS address.
DNS is Domain Name Server (or Service- I've seen both). There is no DNS address.
Just put your Pi name and address in the Hosts file on the PC. If your router is changing the IP address of the Pi- I assume you're using a Pi- then make the DHCP assignment static on the router. The method differs for different routers. In mine it's called a "fixed DHCP lease".
In Windows 10, the hosts file is located in C:\Windows\System32\drivers\etc
To edit the Windows hosts file, open a Command Prompt as administrator. Right-click on the Window icon and select Command Prompt (Administrator)
Navigate to C:\Windows\System32\drivers\etc . Then use notepad to edit the file: notepad hosts
In my hosts file, for example, I have an Intel Nuc named "Nuc", and the hosts file line is: 192.168.1.64 nuc. Now, from that PC, I can ssh nuc or enter nuc:8123 in the browser address field to open Home Assistant, 'nuc:1880' to open Node-Red.
You should put the same data into the hosts files of all PCs on your local net.
Either, most routers allow you to configure them to give a fixed ip address to certain devices (by detecting their Mac address), or you can just fix your machines IP address to be a static address, or you could install Apples bonjour print services on all windows machines and then you machine will be addressable as its hostname.local. eg mypc.local