# localHostOrDomainIs()

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

`localHostOrDomainIs(host, hostdom)` → boolean

True if host equals hostdom exactly, or host is the unqualified first label of hostdom.

`localHostOrDomainIs("www", "www.corp.example")` and `localHostOrDomainIs("www.corp.example", "www.corp.example")`
are true; `localHostOrDomainIs("www.other.example", "www.corp.example")` is false. Rarely needed in modern PACs.

## Example

```js
if (localHostOrDomainIs(host, "intranet.corp.example")) {
  return "DIRECT";
}
```


## Engine notes

- winhttp: Ignores case: localHostOrDomainIs("WWW", "www.example.com") is true. A host that contains a dot must equal hostdom: localHostOrDomainIs("www.example", "www.example.com") is false. (source: lab, verified 2026-10-11)
