dns.name.label_count

dns.name

label_count(name) -> count

Count the number of labels in a domain name (excluding root)