A command-line tool and local proxy that lets you preview a website at its new server IP before updating DNS records publicly. No editing /etc/hosts, no browser profiles, no confusion.

The problem

When you’re migrating a site to a new server, you want to verify everything works at the new IP before flipping DNS. The traditional approach is editing /etc/hosts — which is fine, but it’s easy to forget to revert, affects your whole machine, and requires root.

How it works

dns-preview starts a local HTTP/HTTPS proxy that intercepts DNS lookups for a specific domain and resolves them to a target IP you specify. Everything else resolves normally.

dns-preview --domain example.com --ip 203.0.113.42 --port 8888

Then configure your browser to use localhost:8888 as its proxy. Only traffic to example.com is rerouted — everything else is untouched.

Features

  • HTTPS support via CONNECT tunneling
  • Per-domain override (everything else resolves normally)
  • No root required
  • Works with any browser or HTTP client that supports a proxy

Installation

go install git.wiredincode.com/nunim/dns-preview@latest

Or grab a binary from the releases page on Forgejo.

Usage

# Preview example.com at a specific IP
dns-preview --domain example.com --ip 203.0.113.42

# Custom proxy port
dns-preview --domain example.com --ip 203.0.113.42 --port 9090

# Verbose mode — shows each intercepted request
dns-preview --domain example.com --ip 203.0.113.42 -v

Then in your browser proxy settings: localhost:8888.

When you’re done, kill the process. Nothing to clean up.