DEEPAK KUMPALA Greetings!
Do we need to check for IP changes periodically? if yes, how can we do it?
Yes, The IP address of an IoT hub is subject to change without notice. To minimize disruption, recommended to use the IoT hub hostname for networking and firewall configuration whenever possible.
However, if your device script does not support fully qualified names, you can use the IP address of the IoT hub.
- For constrained IoT systems without domain name resolution (DNS), IoT Hub IP address ranges are published periodically via service tags before changes take effect. It’s therefore important that you develop processes to regularly retrieve and use the latest service tags. This process can be automated via the service tags discovery API or by reviewing service tags in downloadable JSON format.
- Use the AzureIoTHub.[region name] tag to identify IP prefixes used by IoT Hub endpoints in a specific region. To account for datacenter disaster recovery or regional failover, ensure connectivity to IP prefixes of your IoT hub's geo-pair region is also enabled.
- Setting up firewall rules in IoT Hub may block off connectivity needed to run Azure CLI and PowerShell commands against your IoT Hub. To avoid this, you can add ALLOW rules for your clients' IP address prefixes to re-enable CLI or PowerShell clients to communicate with your IoT Hub.
- When adding ALLOW rules in your devices' firewall configuration, it’s best to provide specific ports used by applicable protocols.
Will OS automatically update DNS IPs?
It depends on your network configuration. If you are using a DNS server that is configured to resolve the hostname of the IoT hub, then the DNS server will automatically update the IP address when it changes. However, if you are using a static IP address in your device script, then you will need to manually update the IP address when it changes.
Do we need to manage this on windows host files?
You do not need to manage this on the Windows host files. Instead, you can use the service tags discovery API or the downloadable JSON format to retrieve the latest IP address ranges for the IoT hub.
I would suggest you, please check Best practices and Limitations on IoT Hub IP addresses for more details.
I hope this helps. Do let me know if you have any further questions.
If the response helped, please do click Accept Answer and Yes . Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.