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



Write-Host "`n===== DNS SERVERS =====" -ForegroundColor Cyan

Get-DnsClientServerAddress -AddressFamily IPv4 |
    Where-Object { $_.ServerAddresses.Count -gt 0 } |
    Select-Object InterfaceAlias, ServerAddresses |
    Format-Table -AutoSize

$Names = @(
    "delivery.clz.ru",
    "stage-delivery.clz.ru"
)

foreach ($Name in $Names) {
    Write-Host "`n===== $Name =====" -ForegroundColor Cyan

    foreach ($Type in @("A", "CNAME")) {
        Write-Host "`nRecord Type: $Type" -ForegroundColor Yellow

        try {
            Resolve-DnsName -Name $Name -Type $Type `
                -DnsOnly -ErrorAction Stop |
                Select-Object Name, Type, IPAddress, NameHost, TTL |
                Format-Table -AutoSize
        }
        catch {
            Write-Host "No DNS answer: $($_.Exception.Message)"
        }
    }
}

Write-Host "`n===== DNS ZONE =====" -ForegroundColor Cyan

Resolve-DnsName clz.ru -Type SOA -DnsOnly |
    Format-List *

Resolve-DnsName clz.ru -Type NS -DnsOnly |
    Format-Table -AutoSize