## POST /api/v2/domains/nameservers/lookup

**Look up current nameservers**

Resolve the current delegated NS records for a domain name. This is a public utility endpoint used before transfer/order flows so callers can offer `use current nameservers` without owning the domain in HostUp yet. It does not require an API key. The response contains at most four nameservers.

### Related Endpoints

- `POST /api/v2/domains/nameservers/validate`: Validate nameservers
- `POST /api/v2/domains/{id}/nameservers`: Update domain nameservers
- `POST /api/v2/orders/preview`: Preview an order

### Headers

- `Accept`: application/json
- No authorization header required.
- `Content-Type`: application/json

### Request Body

- `domain` (string, required): Domain name to resolve. The server normalizes the DNS name before lookup. Example: `example.com`

### Request Examples

#### Look up example.com

```bash
curl -X POST "https://cloud.hostup.se/api/v2/domains/nameservers/lookup" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com"
  }'
```

```json
{
  "domain": "example.com"
}
```

### Response Schema

- `domain` (string, optional) Example: `example.com`
- `nameservers` (array<string>, optional) Example: `["a.iana-servers.net","b.iana-servers.net"]`

### Responses

#### 200 - Resolved nameservers.
```json
{
  "domain": "example.com",
  "nameservers": [
    "a.iana-servers.net",
    "b.iana-servers.net"
  ]
}
```

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/domainName",
      "detail": "`domainName` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 404 - Not found. The resource does not exist or is not owned by the caller.
```json
{
  "type": "https://developer.hostup.se/errors/not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Too many requests. Retry after the limit resets.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```
