We apologize that the translated content is not provided to this page.
前言
RFC 8484的raw dns format太晦涩难懂了,甚至连chatgpt都生成错误,目前找到几个转换的资料供参考。
记录
powershell转换对应get
param (
[string]$hostname = "www.qq.com"
)
#
[byte[]]$dnswire= @(00,00,01,00,00,01,00,00,00,00,00,00)
foreach ($namepart in $hostname.split(".")){
$dnswire += $namepart.length
$dnswire += [System.Text.Encoding]::ascii.GetBytes($namepart)
}
$dnswire += @(00,00,01,00,01)
$dnswireb64 = [Convert]::ToBase64String($dnswire)
$dnswireb64
json方式
curl https://dns.google/resolve?name=www.qq.com&type=A