# dns.getProof

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

Fetches the DNSSEC proof of a DNS name's _ens TXT record. Parameters, return value, errors and examples for dns.getProof in @ensforge/sdk.

Source: https://ensforge.com/docs/reference/sdk/dns/get-proof

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/dns/getProof/index.ts#L52" batchable />

Fetches the DNSSEC proof of a DNS name's `_ens` TXT record.

## When to use [#when-to-use]

Use to fetch a proof once and pass it to [`dns.claim`](/docs/reference/sdk/dns/claim), or to inspect it.

## Details [#details]

- Fetched from the deployment's DNSSEC gateway (ENSIP-17) unless `gatewayUrls` is given.
- Not verified; [`dns.getStatus`](/docs/reference/sdk/dns/get-status) verifies it on-chain.

## Signature [#signature]

```ts
function getProof(client: Like, options: getProof.Options): Promise<getProof.ReturnType>
```

Call it as `ens.dns.getProof(options)` on a client, or `Actions.dns.getProof(client, options)`.

`dns.getProof.request(options)` builds a deferred read for `Actions.batch`. See [Look up many at once](/docs/sdk/look-up-many-at-once).

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `name` (required) | `string` |  | DNS name. Normalized automatically. |
| `gatewayUrls` | `readonly string[]` |  | DNSSEC gateways to use instead of the deployment's. |

Also takes the [read options](/docs/reference/sdk/client#read-options).

## Returns [#returns]

Resolves to `Proof`. Signed RRSets, the record's TXT strings and its signature times.

| Field | Type | Description |
| --- | --- | --- |
| `name` | `string` | DNS name the proof is for, e.g. `_ens.example.com`. |
| `rrsets` | `readonly SignedRRSet[]` | Signed RRSets, root first. |
| `inception` | `number` | Signature inception of the proven record set, as a Unix timestamp; `0` when it does not exist. |
| `expiration` | `number` | Signature expiration of the proven record set, as a Unix timestamp; `0` when it does not exist. |
| `txt` | `readonly string[]` | TXT strings of the proven record set; empty when the record does not exist. |

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_NAME`](/docs/reference/errors/INVALID_NAME) | names that are not DNS names. |
| [`GatewayError`](/docs/reference/errors/gateway-error) | [`GATEWAY_REQUEST_FAILED`](/docs/reference/errors/GATEWAY_REQUEST_FAILED), [`GATEWAY_RESPONSE_INVALID`](/docs/reference/errors/GATEWAY_RESPONSE_INVALID) | the DNSSEC gateway fails. |
| [`UnsupportedError`](/docs/reference/errors/unsupported-error) | [`UNSUPPORTED_ON_DEPLOYMENT`](/docs/reference/errors/UNSUPPORTED_ON_DEPLOYMENT) | without a DNSSEC gateway or `gatewayUrls`. |
| [`NetworkError`](/docs/reference/errors/network-error) | [`RPC_REQUEST_FAILED`](/docs/reference/errors/RPC_REQUEST_FAILED), [`RPC_TIMEOUT`](/docs/reference/errors/RPC_TIMEOUT), [`RATE_LIMITED`](/docs/reference/errors/RATE_LIMITED) | the RPC request fails. |

It can also fail with the errors every read can (`Errors.CommonError`: `ConfigError`, `ContractRevertError`, `InternalError`, `NetworkError`).

See [How errors work](/docs/sdk/errors-explained).

## Examples [#examples]

<Tabs groupId="api" items={["Client","Standalone","Effect"]} persist>
<Tab>
```ts title="Fetching a proof"
const proof = await ens.dns.getProof({ name: "example.com" })
```
</Tab>

<Tab>
```ts title="Fetching a proof with a standalone call"
import { Actions } from "@ensforge/sdk"

const proof = await Actions.dns.getProof(publicClient, { name: "example.com" })
```
</Tab>

<Tab>
```ts title="Fetching a proof in an Effect program"
import { Actions } from "@ensforge/sdk/effect"

const proof = yield* Actions.dns.getProof(ens, { name: "example.com" })
```
</Tab>
</Tabs>

## See also [#see-also]

- [`dns.claim`](/docs/reference/sdk/dns/claim) to import with it