# DNS Lookup API

> DNS records, email security audit (SPF, DMARC, DKIM) with a grade, and SSL certificate expiry.

Three checks every domain needs, in one API: **DNS records**, a graded **email security audit** (SPF, DMARC, DKIM, MTA-STS, BIMI) with the fixes to make, and the **SSL certificate** with its expiry and, when invalid, the reason why.

- Host: `dns-lookup-email-security-ssl-checker.p.rapidapi.com`
- Base URL: `https://dns-lookup-email-security-ssl-checker.p.rapidapi.com/v1/dns`
- Auth: headers `X-RapidAPI-Key` and `X-RapidAPI-Host`
- OpenAPI: https://helenis-api.com/docs/dns/openapi.json

## Endpoints

### DNS Records

A, AAAA, MX, NS, TXT, CAA and other records of a domain.

#### Get DNS Records

`GET /v1/dns/records`

DNS records of a domain. Records with their TTL (and priority for MX), from public resolvers. 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `domain` | query | `string` | yes | Domain or hostname (or any URL of it). | `github.com` |
| `types` | query | `string` | no | Comma-separated types. Default: A, AAAA, CNAME, MX, NS, TXT, SOA, CAA. Also SRV, PTR. | `A,MX,TXT` |

```bash
curl -G "https://dns-lookup-email-security-ssl-checker.p.rapidapi.com/v1/dns/records" \
  --data-urlencode "domain=github.com" \
  --data-urlencode "types=A,MX,TXT" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: dns-lookup-email-security-ssl-checker.p.rapidapi.com"
```

### Email Security

SPF, DMARC, DKIM, MTA-STS and BIMI audit with a grade.

#### Audit Email Security

`GET /v1/dns/email`

Email security audit: SPF, DMARC, DKIM, MX, MTA-STS, BIMI, grade. Grade A-F and score 0-100, mail provider, each check (pass / warn / fail) with its explanation, and the fixes to make. 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `domain` | query | `string` | yes | Domain or hostname (or any URL of it). | `github.com` |

```bash
curl -G "https://dns-lookup-email-security-ssl-checker.p.rapidapi.com/v1/dns/email" \
  --data-urlencode "domain=github.com" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: dns-lookup-email-security-ssl-checker.p.rapidapi.com"
```

### SSL

SSL/TLS certificate details and expiry.

#### Get SSL Certificate

`GET /v1/dns/ssl`

SSL/TLS certificate of a website. Validity (trusted chain, name, dates) and the reason when invalid, issuer, names covered, validity dates and days remaining, key, signature, TLS version and cipher. 1 credit.

| Parameter | In | Type | Required | Description | Example |
|---|---|---|---|---|---|
| `domain` | query | `string` | yes | Domain or hostname (or any URL of it). | `github.com` |

```bash
curl -G "https://dns-lookup-email-security-ssl-checker.p.rapidapi.com/v1/dns/ssl" \
  --data-urlencode "domain=github.com" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: dns-lookup-email-security-ssl-checker.p.rapidapi.com"
```

## Sample call

Audit Email Security: `GET /v1/dns/email`.

```bash
curl -G "https://dns-lookup-email-security-ssl-checker.p.rapidapi.com/v1/dns/email" \
  --data-urlencode "domain=github.com" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: dns-lookup-email-security-ssl-checker.p.rapidapi.com"
```

## Response (/email)

```json
{
  "domain": "github.com",
  "grade": "C",
  "score": 65,
  "mx": [{ "value": "github-com.mail.protection.outlook.com", "ttl": 300, "priority": 0 }],
  "provider": "Microsoft 365",
  "mx_check": { "status": "pass", "message": "1 mail server(s)." },
  "spf": {
    "record": "v=spf1 ip4:192.30.252.0/22 include:spf.protection.outlook.com include:_netblocks.google.com ... ~all",
    "all": "~all",
    "includes": ["spf.protection.outlook.com", "_netblocks.google.com", "_netblocks2.google.com", "mail.zendesk.com", "_spf.salesforce.com", "servers.mcsv.net", "mktomail.com", "sendgrid.net"],
    "lookups": 10,
    "check": { "status": "warn", "message": "10 DNS lookups out of 10: one more sender breaks SPF." }
  },
  "dmarc": {
    "record": "v=DMARC1; p=quarantine; sp=reject; pct=100; rua=mailto:dmarc@github.com; ruf=mailto:dmarc@github.com; fo=1",
    "policy": "quarantine",
    "subdomain_policy": "reject",
    "pct": 100,
    "rua": ["mailto:dmarc@github.com"],
    "check": { "status": "pass", "message": "DMARC quarantines spoofed mail (p=quarantine)." }
  },
  "dkim": { "selectors_found": ["google", "selector1", "k1", "k2", "s1", "s2", "cm"], "check": { "status": "pass", "message": "DKIM key found (google, selector1, k1, k2, s1, s2, cm)." } },
  "mta_sts": { "status": "warn", "message": "No MTA-STS: mail to this domain can be downgraded to plain text." },
  "bimi": { "status": "warn", "message": "No BIMI logo." },
  "recommendations": [
    "Bring SPF below 10 DNS lookups: remove senders you no longer use or replace includes with their IP ranges.",
    "Enable MTA-STS to enforce encrypted delivery."
  ]
}
```

*A real response (20 Nov 2026); only the SPF record is shortened.* Even github.com gets a C: 10 SPF lookups out of 10 allowed, and no MTA-STS.

## Response (/ssl)

```json
{
  "domain": "expired.badssl.com",
  "host": "expired.badssl.com:443",
  "valid": false,
  "error": "certificate has expired",
  "issuer": "COMODO RSA Domain Validation Secure Server CA",
  "names": ["*.badssl.com", "badssl.com"],
  "valid_until": "2015-04-12T23:59:59Z",
  "days_remaining": -4238,
  "key": "RSA 2048",
  "protocol": "TLSv1.2"
}
```

## How the grade works

SPF up to 30 points, DMARC up to 35, DKIM up to 20, MTA-STS 10, BIMI 5. A ≥ 85, B ≥ 70, C ≥ 50, D ≥ 30, F below.

A null MX (`0 .`, RFC 7505) is read as "this domain accepts no mail": MTA-STS is then not needed, and neither is DKIM when SPF is `v=spf1 -all` (a parked domain done right). Recommendations follow what is published: a domain at `p=none` is told to move to quarantine, then reject.

## Errors

| Status | `code` | Meaning |
|---|---|---|
| 400 | `invalid_domain`, `invalid_request` | Not a domain, or an unknown record type. |
| 400 | `site_unreachable` | No TLS answer on port 443 (`/ssl`). |
| 429 | `daily_limit_reached` | Daily safety limit of your plan; resets at 00:00 UTC. |
| 503 | `dns_timeout` | The DNS servers did not answer. Retry. Not billed. |

## Pricing

1 credit per call. Failed calls are never billed.

| Plan | Price | Credits included | Above the quota |
|---|---|---|---|
| BASIC | Free | 10 / day | resets every day |
| PRO | $3.99/month | 50,000 / month | $0.0008 per credit |
| ULTRA | $9.99/month | 250,000 / month | $0.0008 per credit |
| MEGA | $29.99/month | 1,000,000 / month | $0.0008 per credit |

Apify actor **DNS Lookup, Email Security & SSL Checker**: billed per event; free-plan users get 50 domains per run.

| Event | Charged for | Price |
|---|---|---|
| `email-audit` | each email-security audit | $0.0012 |
| `ssl-check` | each SSL certificate check | $0.0005 |
| `dns-records` | each DNS lookup | $0.0005 |

## Links

- API reference (HTML): https://helenis-api.com/docs/dns
- OpenAPI: https://helenis-api.com/docs/dns/openapi.json
- Overview and pricing: https://helenis-api.com/apis/dns/
- RapidAPI listing: https://rapidapi.com/helenis-api-helenis-api-data/api/dns-lookup-email-security-ssl-checker?utm_source=helenis&utm_medium=site&utm_campaign=dns&utm_content=markdown
- Apify actor: https://apify.com/helenisapi/dns-email-security-ssl-checker?utm_source=helenis&utm_medium=site&utm_campaign=dns&utm_content=markdown
- MCP server (Apify): https://mcp.apify.com?tools=helenisapi/dns-email-security-ssl-checker

MCP: Works in Claude, Cursor, VS Code and any MCP client; billed per event through Apify (your Apify token).

## Conventions (every Helenis API)

- Auth: two headers on every call, `X-RapidAPI-Key` (your key) and `X-RapidAPI-Host` (the API's host). One RapidAPI key works for every API you subscribe to.
- Billing in credits: one for a simple call, more for heavier work (a minute of audio, a page read by AI). Each API states its rule.
- Failed calls are never billed: a `4xx` bills zero credits and a `5xx` is never counted.
- Errors share one envelope: `{"error": {"status", "code", "message"}}` with a stable machine-readable `code`.
- `400`: fix the input (validation errors are always 400, never 422); not billed.
- `429`: rate limit; wait for `Retry-After`. `503`: temporary upstream or AI failure (`ai_error`, `upstream_timeout`); retry later, not billed.
- Values the source does not give come back as `null`, never invented.
