[英]Changing DNS settings in openwrt uci command line
如何在openwrt路由器中使用命令行更改DNS設置? 我在這里看到這些文件
/etc/config/ddns
/etc/config/ipset-dns
但我發現安裝了dnsmasq
但不確定哪個可以更改路由器上的DNS服務器
我的最終目標是添加一個cron作業,每天添加幾個小時的自定義DNS,然后還原為原始DNS
編輯:我發現以下命令,有人可以解釋嗎?
uci set network.wan.dns='<list of space-separated DNS server IPs>'
uci commit network
reload_config
和
uci set network.wan.peerdns='0'
uci del network.wan.dns
uci add_list network.wan.dns='9.9.9.9'
uci add_list network.wan.dns='149.112.112.112'
uci commit
您可以通過執行以下操作將DNS請求轉發到特定服務器:
uci add_list dhcp.@dnsmasq[0].server="SERVER_ADDRESS"
uci commit dhcp
service dnsmasq restart
或/etc/init.d/dnsmasq restart
您可以在此處閱讀有關此內容的更多信息: https : //openwrt.org/docs/guide-user/base-system/dhcp_configuration (向下滾動或找到“ DNS轉發”)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.