Azure / iotedge

The IoT Edge OSS project
MIT License
1.46k stars 461 forks source link

It seems DNS is not taken from system settings #6261

Closed xirami closed 2 years ago

xirami commented 2 years ago

Expected Behavior

edgeHub shall takeover system setting of DNS servers. No need to setup docker.json daemon DNS record as indicated in iotEdge FAQ for empty config

Current Behavior

edgeHub can't connect to cloud, so edge receives empty configuration, subsequently error depicted in attached printscreen happens. Especially in environments with transparent proxy but firewall filtering, where particular gateway and DNS is given by customer IT, setting DNS to 1.1.1.1 might fail. Initially, even when system was configured by nmcli, edgeHub was not able to connect. After explicit setting of /etc/docker/daemon.json to customer IT provided DNS, all works.

image

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. install iotEdge, latest greatest
  2. put it after proxy/firewall which restricts global DNSs (1.1.1.1)
  3. iotEdge edgeAgent will not connect
  4. then, setup dedicated DNS/forwarder, use the address

Context (Environment)

N/A

Output of iotedge check

Click here ![image](https://user-images.githubusercontent.com/3624673/161944015-05228248-d39b-47dd-ab84-1cdc70071638.png)

Device Information

Runtime Versions

Logs

aziot-edged logs ``` ```
edge-agent logs ``` ```
edge-hub logs ``` ```

Additional Information

Please provide any additional information that may be helpful in understanding the issue.

darobs commented 2 years ago

Hi @ondrejspilka,

The example given in the documentation is not expected to be an exhaustive answer. Our team needs to configure the DNS to an internal DNS server for devices inside the corporate network, but we use a public DNS server for the example.

We place all modules except edgeAgent into a custom bridge docker network named azure-iot-edge. This lets the user look up modules by name in module code. However, this does affect how DNS works inside the container. It uses Docker's embedded DNS service.

According to the Docker documentation above, the default bridge network will automatically use the host's DNS configuration. If you want to switch to using the default "bridge" network, it's configurable in the config.toml: https://github.com/Azure/iotedge/blob/main/edgelet/contrib/config/linux/template.toml#L400

I am marking this as a "docs" issue because I'm sure our documentation could be more clear on this subject.

darobs commented 2 years ago

Closing this issue, please reopen if you have any follow-up questions. (Closing this issue won't stop this being tracked as a potential documentation improvement.)