dnsDomainLevels()
Number of dots in the host name ("www.corp.example" gives 2).
dnsDomainLevels(host) → numberCounts dots, so it also counts them in IP literals: dnsDomainLevels("10.1.2.3") is 3.
Example
if (dnsDomainLevels(host) == 0) {
return "DIRECT";
}
Availability
| Function | chromium | chromium | firefox | pacparser | pacparser | pacparser | reference |
|---|---|---|---|---|---|---|---|
dnsDomainLevels | yes | yes | yes | yes | yes | yes | yes |