Comments (1)
The first thing you should do is read this project is dormant and then, assuming you didn't open the issue here on gcgarner by mistake, migrate to SensorsIot/IOTstack.
The SensorsIot documentation for Node-RED has a whole section on component management which you might find helpful.
If you need to migrate, please make sure you carefully compare/contrast your existing service definitions in your
docker-compose.yml
with those in~/IOTstack/.templates
. There have been many many changes. Your existing unmodifieddocker-compose.yml
will probably work "as is" but you won't get the benefit of any improvements.
What you are seeing in /etc/resolv.conf
inside the container is correct. 127.0.0.11 is a special Docker IP address which basically means "use the host system's DNS configuration" (ie what you see in the Pi's /etc/resolv.conf
).
From inside the container, you should be able to resolve the following:
$ docker exec nodered getent hosts mosquitto
172.30.0.6 mosquitto mosquitto
$ docker exec nodered getent hosts www.google.com
2404:6800:4006:80f::2004 www.google.com www.google.com
The first one is asking for the IP address of the Mosquitto container in container-space (the iotstack_default
network).
If you aren't running Mosquitto then substitute the name of another container
The second one is, obviously, querying outside container-space.
If both work then DNS is working. If the first works but the second does not, it implies that DNS is working but you have a configuration or reachability problem for your Pi getting DNS.
If neither work (which I've never seen) I would guess you might be better off nuking everything and starting over.
If you decide to do that, perhaps take a look at PiBuilder. If you've got a lot of existing data you want to preserve, perhaps also take a look at IOTstackBackup.
Now, when it comes to 192.168.0.1, here's what usually happens. Your router boots. It connects to your ISP. As part of the PPP setup, your ISP allocates an IP address to the WAN side of your router and also provides (typically) two IP addresses of DNS servers that the ISP maintains.
When a client on your LAN boots and issues a DHCP request, your router (which will usually be running as a DHCP server) answers and allocates an IP address to the client. As part of the DHCP lease, the DHCP server tells the client to use the router's IP address for DNS.
When the client issues a DNS query, it's directed to 192.168.0.1 and a DNS resolver running in the router forwards the query to the DNS servers operated by the ISP.
DNS servers run by ISPs are not always the best choice. Quite a few ISPs seem to configure their DNS servers to not operate recursively. I have no idea why they do that but it can often lead to stuff-ups of the type you seem to be having with Node-RED. ISPs also sometimes try to reduce their DNS traffic overheads by deliberately ignoring time-to-live settings on domain names. That can lead to serious stuff-ups with things like DuckDNS and WireGuard.
Some ISPs even try to get into the advertising game by trapping DNS mistakes (eg when you type "microsof" without the "t") and serving you ads instead. All best avoided.
The best thing you can do is to get into your router and ferret around until you find the controls that tell DHCP which DNS servers to hand out in leases. I don't know which router you're using so take this with a grain of salt but many routers have two fields for DNS servers. Yours is probably either defaulting to 192.168.0.1 with the second field left empty, or both are empty which the the DHCP server is intepreting as "use 192.168.0.1". Set the DNS server fields to some combination of 8.8.8.8, 8.8.4.4 and 1.1.1.1. The 8.8s are Google, the 1.1.1.1 is Cloudflare. You lose nothing by avoiding your ISP's DNS servers. You gain reliable DNS by using Google and/or Cloudflare.
Alternatively, tell the Pi which DNS servers to use by sticking this line towards the end of /etc/resolvconf.conf
:
name_servers="8.8.8.8 8.8.4.4 1.1.1.1"
followed by:
$ sudo resolvconf -u
You should see the changes come through into /etc/resolv.conf
and then getent
queries run inside the container via 127.0.0.11 should start using those servers too.
Hope this helps.
from iotstack.
Related Issues (20)
- InfluxDb data not in backup HOT 3
- menu.sh error HOT 2
- unable to stop and remove Hassio containers in IOTstack HOT 1
- zigbee2mqtt
- menu.sh just checks for current version HOT 2
- Home Assistant Native keeps coming back after removal HOT 1
- Zigbee2MqttAssistant: Unable to connect to MQTT server mosquitto HOT 2
- chown -R 1883:1883 ./volumes/mosquitto does not accept "Y" HOT 1
- ImportError: No module named 'blessed' HOT 1
- running rtl_433 container problem HOT 7
- influxdb.conf ... changing the retention of data HOT 1
- how to retrive an old image HOT 5
- How Do I get rid of Pihole ? I tried everything. HOT 5
- IOT stack vs raspberry pi OS bullseye HOT 5
- installation script incorrectly prompting version types HOT 2
- Concerned about prerequisites HOT 3
- pi.hole only works intermittently. HOT 3
- Cannot start service nodered /dev/ttyAMA0 HOT 2
- i2c in nodered HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iotstack.