{
  "openapi": "3.0.3",
  "info": {
    "title": "DNS Lookup",
    "description": "Resolve DNS records (A, AAAA, MX, TXT, NS, CNAME, SOA) and reverse-lookup any IP — fast, no setup.",
    "version": "1.0.0"
  },
  "components": {
    "schemas": {}
  },
  "paths": {
    "/records": {
      "get": {
        "summary": "Resolve DNS records for a domain",
        "tags": [
          "DNS"
        ],
        "description": "Returns DNS records of the requested type for the given domain.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "example": "example.com",
            "in": "query",
            "name": "domain",
            "required": true,
            "description": "Domain name"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "A",
                "AAAA",
                "MX",
                "TXT",
                "NS",
                "CNAME",
                "SOA"
              ],
              "default": "A"
            },
            "example": "MX",
            "in": "query",
            "name": "type",
            "required": false,
            "description": "Record type"
          }
        ],
        "responses": {
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/lookup": {
      "get": {
        "summary": "Lookup A and AAAA records",
        "tags": [
          "DNS"
        ],
        "description": "Resolves both IPv4 and IPv6 addresses for a domain.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "example": "example.com",
            "in": "query",
            "name": "domain",
            "required": true,
            "description": "Domain name"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Successful response",
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "a": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "aaaa": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/reverse": {
      "get": {
        "summary": "Reverse DNS lookup",
        "tags": [
          "DNS"
        ],
        "description": "Find hostnames associated with an IP address.",
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "example": "8.8.8.8",
            "in": "query",
            "name": "ip",
            "required": true,
            "description": "IP address"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Successful response",
                  "type": "object",
                  "properties": {
                    "ip": {
                      "type": "string"
                    },
                    "hostnames": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://web-toolbox-api-production.up.railway.app/dns",
      "description": "Production"
    }
  ]
}