Getvar
To retrieve a space-delimited list of domains currently in use by the device, up to five domains. The list will contain a mixture of domains received from DHCPv4, DHCPv6, and user-set values depending upon address acquisition settings, using the following rules:
IPv4 sources are the priority.
If IPv4 the source provides five domains, there will only be IPv4-sourced domains.
If there are slots to fit more domains, they will be filled with IPv6 sources.
! U1 getvar "wlan.ip.dns.domain"
Retrieved values are always the values currently in use, which may not match values that were just set, depending on if you are using a static or auto address type.