# dnsDomainLevels()

Source: https://findproxyforurl.net/functions/dnsdomainlevels/ · last updated 2026-10-11

`dnsDomainLevels(host)` → number

Number of dots in the host name ("www.corp.example" gives 2).

Counts dots, so it also counts them in IP literals: `dnsDomainLevels("10.1.2.3")` is 3.

## Example

```js
if (dnsDomainLevels(host) == 0) {
  return "DIRECT";
}
```


## Engine notes

- winhttp: Counts dots like the other engines: "www" gives 0, "www.example.com" 2 and "example.com." 2. (source: lab, verified 2026-10-11)
