# Dns class code lookup

`dns-class-code-lookup` · version 1.0.0 · Communications · free, no key needed

Look up a pinned DNS class mnemonic or its numeric code.

**Use when you need to: dns class mnemonic to number · lookup dns rr class code · iana dns class code table.**

## Decide before calling

Read the [versioned contract](/v1/tools/dns-class-code-lookup/versions/1.0.0) and the supported scope below. Reuse `dns-class-code-lookup@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `dns-class-code-lookup@1.0.0` for dns class mnemonic to number. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- dns class mnemonic to number
- lookup dns rr class code
- iana dns class code table
- what number is the dns class in
- convert dns class name and code
- dns class code for in ch hs any
- איתור קוד מחלקת רשומת דיאן אס

## Not supported

- encode or decode DNS RDATA
- choose a class for a zone
- query a DNS resolver

## Behavior

- Provide exactly one of name or code. The pinned classes are IN 1, CS 2, CH 3, HS 4, NONE 254 and * 255. ANY is an alias of * and the returned name is *.
- query_only is true only for * (RFC 1035 QCLASS). NONE is reserved for RFC 2136 update prerequisites and updates, so query_only is false.
- A mnemonic or code outside the excerpt is unsupported_input. Lowercase text, an empty name, both fields, or neither field is invalid_input.
- data_version is iana-dns-parameters-2026-10-21. This tool does not encode RDATA and does not send a DNS query.
- More than 512 UTF-8 bytes of JSON input, or a name longer than 4 characters, is limit_exceeded.

## Input

- `name` (string, optional): min length 1; max length 4
- `code` (integer, optional): min 0; max 65535

## Output

- `data_version` (constant "iana-dns-parameters-2026-10-21", required)
- `name` (string, required): min length 1; max length 4
- `code` (integer, required): min 0; max 65535
- `defining_document` (string, required): min length 8; max length 12
- `query_only` (boolean, required)

## Limits

- max input bytes: 512
- max name chars: 4

## Example

Request input:

```json
{
  "name": "IN"
}
```

Response:

```json
{
  "result": {
    "data_version": "iana-dns-parameters-2026-10-21",
    "name": "IN",
    "code": 1,
    "defining_document": "RFC 1035",
    "query_only": false
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "dns-class-code-lookup",
  "version": "1.0.0",
  "input": {
    "name": "IN"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/dns-class-code-lookup/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"name":"IN"}'
```

The machine-readable contract is at [/v1/tools/dns-class-code-lookup/versions/1.0.0](/v1/tools/dns-class-code-lookup/versions/1.0.0).

### CLI

```sh
node cli.mjs run dns-class-code-lookup 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Dns type code lookup](/tools/dns-type-code-lookup): Look up a pinned DNS RR type mnemonic or its numeric code.
- [Dns header flags explain](/tools/dns-header-flags-explain): Explain an RFC 1035 DNS header flags word, with reserved Z as an integer 0 through 7.
- [Dns message encode](/tools/dns-message-encode): Encode a structured DNS message to canonical uncompressed RFC 1035 wire hex.
- [Dns message parse](/tools/dns-message-parse): Parse a DNS message hex string into the RFC 1035 header, questions, and resource records.
- [Email address list deduplicate](/tools/email-address-list-deduplicate): Drop duplicate mailboxes in an RFC 5322 address-list, keeping the first one.
- [Email address list format](/tools/email-address-list-format): Format mailboxes and groups as one deterministic RFC 5322 address-list.
