Skip to content

eyupfidan/whois-scope

Repository files navigation

WhoisScope β€” Fast WHOIS lookup API and web app

MIT License PHP 8.3+ Laravel 13 Vue 3 Tailwind CSS 4 Domain-Driven Design

WhoisScope is an open-source WHOIS lookup platform built with Laravel and Vue.js.
Use it as a REST API, a full-stack web app, or both β€” with caching, rate limiting, bulk queries, and a multilingual UI.

Quick Start Β· Features Β· API Β· Configuration Β· Architecture Β· License


Overview

WhoisScope lets you look up domain registration data through a clean web interface or a versioned JSON API. It parses raw WHOIS responses, detects whether a domain is registered, available, or unknown, and returns structured fields such as registrar, creation date, expiry date, and status codes.

The project follows Domain-Driven Design (DDD) so business rules stay independent from Laravel, the WHOIS library, and the Vue frontend.

WhoisScope icon

Mode Best for
Web UI Manual lookups, bulk CSV export, exploring results
REST API Integrations, scripts, backend services
API + UI Self-hosted product with built-in documentation at /docs

✨ Features

Feature Description
πŸ” Single lookup Query one domain with summary or full response format
πŸ“¦ Bulk lookup Up to 50 domains per request, parallel processing, per-domain status
⚑ Smart cache Results cached by default (1 hour); repeat queries are near-instant
πŸ›‘οΈ Rate limiting Per-IP limits on single and bulk endpoints
🌍 Multilingual UI 7 languages in the web interface
πŸ“„ CSV export Download bulk results from the web UI
🎯 Registration status registered, available, unknown, or error per domain
πŸ“š Built-in API docs Interactive reference at /docs
πŸ”“ MIT licensed Free for personal and commercial use

πŸš€ Quick Start

Requirements

Tool Version
PHP 8.3 or higher
Composer 2.x
Node.js 20+ (for frontend build)
SQLite Included (default) or MySQL/PostgreSQL

Installation

git clone https://github.com/your-org/whois-api.git
cd whois-api

composer install
cp .env.example .env
php artisan key:generate
php artisan migrate

npm install
npm run build

Run locally

Option A β€” Full stack (recommended for first run)

# Terminal 1
php artisan serve

# Terminal 2
npm run dev

Open http://localhost:8000

Page URL
Home (lookup UI) /
API documentation /docs

Option B β€” API only

php artisan serve

The API works without building the frontend. Endpoints are available under /api/v1/whois/*.

Option C β€” One command (dev)

composer dev

Runs the PHP server, queue worker, logs, and Vite dev server together.


πŸ–₯️ Web Interface

The UI includes two tabs:

  1. Domain Whois β€” single domain lookup with summary/full format
  2. Bulk Whois β€” paste up to 50 domains (one per line or comma-separated), view accordion results, export CSV

Supported interface languages:

Code Language
en English (default)
tr TΓΌrkΓ§e
es EspaΓ±ol
fr FranΓ§ais
pt PortuguΓͺs
zh δΈ­ζ–‡
ar Ψ§Ω„ΨΉΨ±Ψ¨ΩŠΨ©

πŸ“‘ API Reference

Base URL: http://localhost:8000/api/v1/whois

Endpoints

Method Endpoint Rate limit Description
GET /whois/{domain} 60/min per IP Single domain lookup
POST /whois/bulk 10/min per IP Bulk domain lookup

Query / body parameters

Parameter Location Values Default
format query or JSON body summary, full summary
domains JSON body (bulk only) array of strings, max 50 β€”

Response formats

summary β€” essential fields:

domain, registration_status, registrar, created_at, expires_at, states

full β€” all parsed fields plus raw WHOIS text:

whois_server, owner, updated_at, name_servers, dnssec, raw, …

Single lookup example

curl -s "http://localhost:8000/api/v1/whois/google.com?format=summary" | jq
{
  "data": {
    "domain": "google.com",
    "registration_status": "registered",
    "registrar": "MarkMonitor Inc.",
    "created_at": "1997-09-15T04:00:00+00:00",
    "expires_at": "2028-09-14T04:00:00+00:00",
    "states": ["client delete prohibited", "client transfer prohibited"]
  }
}

Bulk lookup example

curl -s -X POST "http://localhost:8000/api/v1/whois/bulk" \
  -H "Content-Type: application/json" \
  -d '{
    "domains": ["google.com", "this-domain-is-free-xyz123.com"],
    "format": "summary"
  }' | jq
{
  "format": "summary",
  "results": [
    {
      "domain": "google.com",
      "status": "registered",
      "data": { "domain": "google.com", "registration_status": "registered", "...": "..." }
    },
    {
      "domain": "this-domain-is-free-xyz123.com",
      "status": "available",
      "data": { "domain": "this-domain-is-free-xyz123.com", "registration_status": "available", "...": "..." }
    }
  ]
}

Bulk result statuses

Status Meaning
registered Domain has active WHOIS registration data
available Domain appears unregistered / available
unknown WHOIS response could not be classified confidently
error Lookup failed (invalid domain, timeout, server error)

Error responses

Errors return JSON with message and code:

HTTP Code Typical cause
422 invalid_domain Malformed domain name
429 too_many_requests Rate limit exceeded
502 lookup_failed WHOIS server unreachable or TLD unsupported
500 server_error Unexpected server error

βš™οΈ Configuration

All WHOIS-related settings live in .env and config/whois.php.

# Timeouts (seconds)
WHOIS_TIMEOUT=8
WHOIS_CONNECT_TIMEOUT=3

# Bulk
WHOIS_BULK_LIMIT=50
WHOIS_BULK_CONCURRENCY=5
WHOIS_BULK_MAX_EXECUTION=300

# Cache
WHOIS_CACHE_ENABLED=true
WHOIS_CACHE_TTL=3600

# Rate limits (requests per minute, per IP)
WHOIS_RATE_LIMIT=60
WHOIS_BULK_RATE_LIMIT=10

# Laravel cache driver β€” use redis in production for best performance
CACHE_STORE=database
Variable Default Description
WHOIS_TIMEOUT 8 Max seconds to read WHOIS server response
WHOIS_CONNECT_TIMEOUT 3 Max seconds to open TCP connection (port 43)
WHOIS_BULK_CONCURRENCY 5 Parallel lookups during bulk requests
WHOIS_BULK_LIMIT 50 Max domains per bulk request
WHOIS_CACHE_TTL 3600 Cache lifetime in seconds (1 hour)
WHOIS_RATE_LIMIT 60 Single lookup requests per minute per IP
WHOIS_BULK_RATE_LIMIT 10 Bulk requests per minute per IP

Tip: For production, set CACHE_STORE=redis and keep WHOIS_CACHE_ENABLED=true. Cached lookups typically respond in ~1 ms.

Custom WHOIS servers for specific TLDs can be added in config/whois.php under custom_servers.


πŸ—οΈ Architecture

WhoisScope uses a layered DDD structure:

flowchart TB
    subgraph Presentation
        UI[Vue 3 Web UI]
        API[Laravel API Controllers]
    end

    subgraph Application
        UC1[LookupWhoisUseCase]
        UC2[BulkLookupWhoisUseCase]
    end

    subgraph Domain
        ENT[WhoisRecord]
        VO[Value Objects]
        REPO_IF[WhoisRepositoryInterface]
    end

    subgraph Infrastructure
        CACHE[CachedWhoisRepository]
        PHP[PhpWhoisRepository]
        LIB[io-developer/php-whois]
    end

    UI --> API
    API --> UC1 & UC2
    UC1 & UC2 --> REPO_IF
    REPO_IF --> CACHE
    CACHE --> PHP
    PHP --> LIB
    PHP --> ENT
Loading

Directory layout

app/
β”œβ”€β”€ Domain/Whois/              # Entities, value objects, domain services, exceptions
β”œβ”€β”€ Application/Whois/         # Use cases, DTOs, application services
β”œβ”€β”€ Infrastructure/Whois/      # php-whois adapter, cache decorator, socket loader
β”œβ”€β”€ Http/                      # Controllers, form requests, API resources
└── Providers/                 # DI bindings, rate limiters

resources/js/                  # Vue 3 SPA (router, i18n, components)
routes/
β”œβ”€β”€ api.php                    # /api/v1/whois/*
└── web.php                    # SPA catch-all

Request flow (single lookup)

sequenceDiagram
    participant Client
    participant API as WhoisController
    participant UC as LookupWhoisUseCase
    participant Cache as CachedWhoisRepository
    participant WHOIS as PhpWhoisRepository
    participant Server as WHOIS Server :43

    Client->>API: GET /api/v1/whois/example.com
    API->>UC: execute(domain)
    UC->>Cache: lookup(domain)
    alt cache hit
        Cache-->>UC: WhoisRecord
    else cache miss
        Cache->>WHOIS: lookup(domain)
        WHOIS->>Server: TCP WHOIS query
        Server-->>WHOIS: raw text
        WHOIS-->>Cache: WhoisRecord
        Cache-->>UC: WhoisRecord
    end
    UC-->>API: WhoisRecord
    API-->>Client: JSON response
Loading

πŸ§ͺ Tests

php artisan test

The test suite covers API responses, caching, rate limiting, and registration status detection.


πŸ“¦ Tech Stack

Laravel Vue Vite Tailwind php-whois

Layer Technology
Backend Laravel 13, PHP 8.3+
WHOIS library io-developer/php-whois
Frontend Vue 3, Vue Router, Tailwind CSS 4, Vite 8
Cache Laravel Cache (database, file, or Redis)
Database SQLite by default

🀝 Contributing

Contributions are welcome. Please open an issue or pull request. By contributing, you agree that your code will be released under the MIT License.


πŸ“„ License

MIT License

WhoisScope is open source software licensed under the MIT License.

You may use, copy, modify, merge, publish, distribute, sublicense, and sell copies of the software β€” for personal or commercial projects β€” as long as the license notice is included.



Built with Laravel & Vue Β· MIT Licensed

About

Open-source WHOIS lookup platform with REST API and Vue.js UI. Single & bulk domain queries, caching, rate limiting, registration status, CSV export. Built with Laravel 13. MIT licensed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors