menu
Thinking Null
phonelink
more_vert
chevron_right
首页
»
Linux
» 正文
DoH的滥用方法
2020-10-05 |
Linux
| 暂无评论 | 97 次阅读 | 113字
受到 [233v2ray 安装脚本](https://github.com/233boy/v2ray/blob/master/install.sh "233v2ray 安装脚本")的启发,我想,dns也可以做很多事情,特别是[DoH](https://awsl.blog/https/dnscrypt-proxy "DoH")出现后,可以通过通用的https协议完成许多操作,安全快捷。 先看下列脚本是怎么使用doh的: ```shell domain_check() { # if [[ $cmd == "yum" ]]; then # yum install bind-utils -y # else # $cmd install dnsutils -y # fi # test_domain=$(dig $domain +short) # test_domain=$(ping $domain -c 1 -4 | grep -oE -m1 "([0-9]{1,3}\.){3}[0-9]{1,3}") # test_domain=$(wget -qO- --header='accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) test_domain=$(curl -sH 'accept: application/dns-json' "https://cloudflare-dns.com/dns-query?name=$domain&type=A" | grep -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" | head -1) if [[ $test_domain != $ip ]]; then echo echo -e "$red 检测域名解析错误....$none" echo echo -e " 你的域名: $yellow$domain$none 未解析到: $cyan$ip$none" echo echo -e " 你的域名当前解析到: $cyan$test_domain$none" echo echo "备注...如果你的域名是使用 Cloudflare 解析的话..在 Status 那里点一下那图标..让它变灰" echo exit 1 fi }```
本篇文章未指定许可协议。
None
发表评论
暂无评论
textsms
说点什么...
内容不能为空
account_circle
昵称
昵称不能为空
email
邮箱
请按格式填写邮箱
link
网站
请按格式填写网站
取消回复
提交评论
keyboard_arrow_up