---
title: "DNS"
description: "Static DNS related functions."
canonical_url: "https://www.zeyos.com/zymba/ref/dns"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/dns.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# DNS

## DNS

```
object @DNS() {
	exists(string $host, string $type): bool {}
	isValidDomain(string $domain): bool {}
	isValidHost(string $host): bool {}
	isValidIP(string $ip): bool {}
	lookup(string $domain): string {}
	resolve(string $domain, string $type): object {}
	reverse(string $ip): string {}
}
```

**Static DNS related functions.**

## Functions


### `@DNS.exists()`


Determines whether a DNS record of a specific type exists for a host (domain name or IP address).

```code
@DNS.exists(string $host, string $type): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| host | `string`  |  | "" |
| type | `string`  |  | "any" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `@DNS.isValidDomain()`


Determines whether a domain name is valid.

```code
@DNS.isValidDomain(string $domain): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| domain | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `@DNS.isValidHost()`


Determines whether a host (domain name or IP address) is valid.

```code
@DNS.isValidHost(string $host): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| host | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `@DNS.isValidIP()`


Determines whether an IP address is valid.

```code
@DNS.isValidIP(string $ip): bool
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| ip | `string`  |  | "0.0.0.0" |

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `@DNS.lookup()`


Resolves a domain name and returns its IP address.

```code
@DNS.lookup(string $domain): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| domain | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |
| `null` |  |




### `@DNS.resolve()`


Resolves a domain name into the DNS records of a specific type.

```code
@DNS.resolve(string $domain, string $type): object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| domain | `string`  |  | "" |
| type | `string`  |  | "any" |

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [["host": ..., "class": ..., "type": ..., "ttl": ...], ...] |
| `null` |  |




### `@DNS.reverse()`


Reverse resolves an IP address and returns its domain name.

```code
@DNS.reverse(string $ip): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| ip | `string`  |  | "0.0.0.0" |

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |
| `null` |  |
