resolve

command
v0.2.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2026 License: CC0-1.0 Imports: 5 Imported by: 0

README

SOCKS Proxy DNS Resolve Example

A simple CLI example demonstrating how to use socksgo to perform forward DNS lookups (hostname → IP address) through a SOCKS proxy using Tor's SOCKS extension.

Usage

go run . [options]
Options
  • -proxy: SOCKS proxy URL (default: socks5://127.0.0.1:1080?tor)
  • -host: Hostname to resolve (default: example.com)
  • -timeout: Operation timeout (default: 30s)

Examples

Basic Forward Lookup
# Resolve hostname to any IP (IPv4 or IPv6)
go run . -proxy socks5://localhost:1080?tor -host example.com
With Authentication
# Use SOCKS proxy with authentication
go run . -proxy socks5://user:pass@localhost:1080?tor -host google.com
Tor Proxy
# Resolve through Tor daemon SOCKS proxy (default port 9050)
go run . -proxy socks5://localhost:9050?tor -host check.torproject.org

Notes

The ?tor URL option is required to enable Tor's SOCKS extension for DNS resolution. Without it, the LookupIP method will return an error.

Documentation

Overview

nolint

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL