dnsip sensor will expose an IP address, fetched via DNS resolution, as its value. There are two operational modes:
- When you enable the sensor with minimal configuration, it will query the OpenDNS nameservers with the hostname
myip.opendns.com, which will resolve to your external/public IP address.
- If you specify a
hostname, a regular DNS lookup will be performed, providing you the IP the hostname resolves to.
You may also override the nameserver that is being used by setting the
resolver parameter to any nameserver you like.
To enable this sensor, add the following lines to your
# Example configuration.yaml entry sensor: - platform: dnsip
(string)(Optional)The hostname for which to perform the DNS query.
myip.opendns.com(special hostname that resolves to your public IP)
(string)(Optional)Name of the sensor.
myipor hostname without dots if specified
(string)(Optional)The DNS server to target the query at.
(boolean)(Optional)Set this to
falseif IPv6 should be used. When resolving the public IP, this will be the IP of the machine where Home Assistant is running on.
Default value: false
(string)(Optional)The IPv6 DNS server to target the query at.
(integer)(Optional)Defines number of seconds for polling interval.
# Example configuration.yaml entry sensor: # Own public IPv4 address - platform: dnsip # Resolve IP address of home-assistant.io via Google DNS - platform: dnsip hostname: home-assistant.io name: hass resolver: 22.214.171.124