[BC660K-GL] How does device know if it's on a IPv4 or IPv6 network?

The question is in the title.
I’m trying to use AT command: “AT+QIDNSCFG Configure DNS Server Address”

For that the device needs to know what network it is on (IPv4 v.s. IPv6). How can de device know that?

you can run the command to query

AT+CGPADDR

If you are accessing an IPV6 server, you need to configure the DNS IP to an IPV6 address