# resolve

Resolves the record of a second-level domain with the specific type. The maximum resolving depth is 2.

For example, when you resolve a domain "test.neo" with the IPV4 type:

* if the domain has a IPV4 record, then the record is returned directly
* if the domain has a canonical name record "alias.neo", which involves a IPV4 record, then the IPV4 record is returned.

***

### Parameters

| Name | Type    | Description                                                                                                                         | Required |
| ---- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- | -------- |
| name | String  | The second-level domain, e.g. "test.neo"                                                                                            | Required |
| type | Integer | <p>Available types are:<br>1 - IPV4 address record<br>5 - Canonical name record<br>16 - Text record<br>28 - IPV6 address record</p> |          |

### Example

Request body #1

In this example, suppose "test1.neo" has no text record, but it has the cname record "test2.neo"; "test2.neo" has no text record, but it has the cname record "test3.neo"; "test3.neo" has a text record "test3". Then resolving "test1.neo" with the text record will return test3.

```json5
curl --request POST \
  --url http://seed1t4.neo.org:20332/ \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "invokefunction",
  "params": [ "0x538355b776538a5da0b2a08c139b9900b9c0cbb6", "resolve",
                         [
                             {
                                 "type":"String","value":"test1.neo"
                             },
                             {
                                 "type":"Integer","value":"16"
                             }
                         ]
],
  "id": 1
}
'
```

Response body #1

```json5
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "script": "IAwJdGVzdDEubmVvEsAfDAdyZXNvbHZlDBS2y8C5AJmbE4ygsqBdilN2t1WDU0FifVtS",
        "state": "HALT",
        "gasconsumed": "4410468",
        "exception": null,
        "stack": [
            {
                "type": "ByteString",
                "value": "dGVzdDM="
            }
        ]
    }
}
```

Request body #2

In this example, the depth is greater than 2 and no record is found.

```json5
curl --request POST \
  --url http://seed1t4.neo.org:20332/ \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "invokefunction",
  "params": [ "0x538355b776538a5da0b2a08c139b9900b9c0cbb6", "resolve",
                         [
                             {
                                 "type":"String","value":"test1.neo"
                             },
                             {
                                 "type":"Integer","value":"16"
                             }
                         ]
],
  "id": 1
}
'
```

Response body #2

```json5
{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "script": "IAwJdGVzdDEubmVvEsAfDAdyZXNvbHZlDBS2y8C5AJmbE4ygsqBdilN2t1WDU0FifVtS",
        "state": "FAULT",
        "gasconsumed": "4512384",
        "exception": "An unhandled exception was thrown. Too many redirections.",
        "stack": []
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.neo.link/reference/api-reference/resolve.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
