Загрузка данных


$ProxyIP = "192.168.40.211"

# Полный список основных доменов и известных поддоменов пулов
$PoolDomains = @(
    # ViaBTC
    "viabtc.com", "viabtc.top", "viabtc.io",
    
    # Binance Pool (включая подзону poolbinance.com)
    "binance.com", "poolbinance.com", "btc.com", "poolin.com",
    
    # Antpool / F2Pool / EMCD / Braiins
    "antpool.com", "f2pool.com", "emcd.io",
    "foundryusa.com", "braiins.com", "slushpool.com"
)

foreach ($Domain in $PoolDomains) {
    # 1. Создаем зону, если ее еще нет
    $ZoneExists = Get-DnsServerZone -Name $Domain -ErrorAction SilentlyContinue
    if (-not $ZoneExists) {
        Add-DnsServerPrimaryZone -Name $Domain -ZoneFile "$Domain.dns" -ErrorAction SilentlyContinue
        Write-Host "Создана зона: $Domain" -ForegroundColor Yellow
    }

    # 2. Удаляем старые записи A
    Get-DnsServerResourceRecord -ZoneName $Domain -RRType "A" -ErrorAction SilentlyContinue | 
        Remove-DnsServerResourceRecord -ZoneName $Domain -Force -ErrorAction SilentlyContinue

    # 3. Добавляем A-записи для корневого домена (@), 1-го уровня (*), и 2-го уровня (*.*)
    Add-DnsServerResourceRecordA -ZoneName $Domain -Name "@" -IPv4Address $ProxyIP -ErrorAction SilentlyContinue
    Add-DnsServerResourceRecordA -ZoneName $Domain -Name "*" -IPv4Address $ProxyIP -ErrorAction SilentlyContinue
    Add-DnsServerResourceRecordA -ZoneName $Domain -Name "*.*" -IPv4Address $ProxyIP -ErrorAction SilentlyContinue
}

# Очищаем кэш DNS на Windows Server
Clear-DnsServerCache -Force
Write-Host "`nВсе домены и поддомены (включая sha256.poolbinance.com) перенаправлены на $ProxyIP!" -ForegroundColor Green

netsh routing ip nat add portredirect name="WAN" proto=tcp port=8888 privateip=192.168.40.211 privateport=8888
netsh routing ip nat add portredirect name="WAN" proto=tcp port=3333 privateip=192.168.40.211 privateport=3333
netsh routing ip nat add portredirect name="WAN" proto=tcp port=1800 privateip=192.168.40.211 privateport=1800
netsh routing ip nat add portredirect name="WAN" proto=tcp port=25 privateip=192.168.40.211 privateport=25
netsh routing ip nat add portredirect name="WAN" proto=tcp port=443 privateip=192.168.40.211 privateport=443

Resolve-DnsName sha256.poolbinance.com -Server 192.168.10.1