OpenWrt之DNS设置
OpenWrt之DNS设置
0.前言
本文不涉及smartdns、adguardhome、dns防污染等内容,只介绍DNS的设置
1.WAN口
保存&应用后 客户机发出dns解析请求后路由器用上面的dns回应
2.Lan口
进入openwrt的luci页面。在 网络>网卡>LAN 选择编辑
保存&应用后,路由器自身的dns解析请求 会使用 上面设置的DNS 来回应
3.LAN口DHCP选项
进入openwrt的luci页面。在 网络>网卡>LAN 选择编辑
在 DHCP选项下 填入
6,223.5.5.5,119.29.29.29
效果如下:
该设置会修改连接到路由器LAN的DNS(类似于自定义电脑的DNS)
4.DHCP/DNS
5.总结
电脑DNS(LAN) > DHCP的DNS > WAN口DNS
1.最常用的DNS设置方式。可以由DHCP请求获得,或自行设置。在静态IP的情况下,必须设置,否则无法查询外面的主机
2.如果路由器用于桥接方式,并且使用静态IP时,无法用DHCP请求的方式得到DNS,这是该选项的主要用途。其他场合下,则会忽略由DHCP服务器的DNS设置,改用这个设置。
3.如果该机器是子网的DHCP服务器,用于设置DHCP客户端的DNS。如果留空,默认则用自身的IP。通常客户端看到的DNS是这个(手机,电脑等)
4.如果自己是子网的DNS服务器,用于设置转发服务器。如果不设置,则用上游DNS(由1或2)服务器
当第2、3、4项不设置时,默认使用1的DNS解析
参考(Thanks)
https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml#options
https://blog.csdn.net/weixin_41632560/article/details/89448612
https://www.right.com.cn/forum/thread-4059633-1-1.html
附录.DHCP OPTION
以下是部分DHCP OPTION参照表
| DHCP OPTION | Meaing |
|---|---|
| 0 | None |
| 1 | 设置子网掩码 |
| 2 | "Time Offset in Seconds from UTC |
| 3 | 设置网关 |
| 4 | N/4 Timeserver addresses |
| 5 | N/4 IEN-116 Server addresses |
| 6 | 设置DNS服务器 |
| 7 | N/4 Logging Server addresses |
| 8 | N/4 Quotes Server addresses |
| 9 | N/4 Printer Server addresses |
| 10 | N/4 Impress Server addresses |
| 11 | N/4 RLP Server addresses |
| 12 | 设置域名选项。 |
| 13 | Size of boot file in 512 byte chunks |
| 14 | Client to dump and name the file to dump it to |
| 15 | 设置域名后缀选项。 |
| 16 | Swap Server address |
| 17 | Path name for root disk |
| 18 | Path name for more BOOTP info |
| 19 | Enable/Disable IP Forwarding |
| 20 | Enable/Disable Source Routing |
| 21 | Routing Policy Filters |
| 22 | Max Datagram Reassembly Size |
| 23 | Default IP Time to Live |
| 24 | Path MTU Aging Timeout |
| 25 | Path MTU Plateau Table |
| 26 | Interface MTU Size |
| 27 | All Subnets are Local |
| 28 | Broadcast Address |
| 29 | Perform Mask Discovery |
| 30 | Provide Mask to Others |
| 31 | Perform Router Discovery |
| 32 | Router Solicitation Address |
| 33 | 设置静态路由选项。该选项中包含一组有分类静态路由(即目的地址的掩码固定为自然掩码,不能划分子网),客户端收到该选项后,将在路由表中添加这些静态路由。如果存在Option121,则忽略该选项。 |
| 34 | Trailer Encapsulation |
| 35 | ARP Cache Timeout |
| 36 | Ethernet Encapsulation |
| 37 | Default TCP Time to Live |
| 38 | TCP Keepalive Interval |
| 39 | TCP Keepalive Garbage |
| 40 | NIS Domain Name |
| 41 | NIS Server Addresses |
| 42 | NTP Server Addresses |
| 43 | Vendor Specific Information |
| 44 | 设置NetBios服务器选项。 |
| 45 | NETBIOS Datagram Distribution |
| 46 | 设置NetBios节点类型选项。 |
| 47 | NETBIOS Scope |
| 48 | X Window Font Server |
| 49 | X Window Display Manager |
| 50 | 设置请求IP选项。 |
| 51 | 设置IP地址租约时间选项。 |
| 52 | 设置Option附加选项。 |
| 53 | 设置DHCP消息类型。 |
| 54 | 设置服务器标识。 |
| 55 | 设置请求参数列表选项。客户端利用该选项指明需要从服务器获取哪些网络配置参数。该选项内容为客户端请求的参数对应的选项值。 |
| 56 | DHCP Error Message |
| 57 | DHCP Maximum Message Size |
| 58 | 设置续约T1时间,一般是租期时间的50%。 |
| 59 | 设置续约T2时间。一般是租期时间的87.5%。 |
| 60 | 设置厂商分类信息选项,用于标识DHCP客户端的类型和配置。 |
| 61 | 设置客户端标识选项。 |
| 62 | NetWare/IP Domain Name |
| 63 | NetWare/IP sub Options |
| 64 | NIS+ v3 Client Domain Name |
| 65 | NIS+ v3 Server Addresses |
| 66 | 设置TFTP服务器名选项,用来指定为客户端分配的TFTP服务器的域名。 |
| 67 | 设置启动文件名选项,用来指定为客户端分配的启动文件名。 |
| 68 | Home Agent Addresses |
| 69 | Simple Mail Server Addresses |
| 70 | Post Office Server Addresses |
| 71 | Network News Server Addresses |
| 72 | WWW Server Addresses |
| 73 | Finger Server Addresses |
| 74 | Chat Server Addresses |
| 75 | StreetTalk Server Addresses |
| 76 | ST Directory Assist. Addresses |
| 77 | 设置用户类型标识。 |
| 78 | directory agent information |
| 79 | service location agent scope |
| 80 | Rapid Commit |
| 81 | Fully Qualified Domain Name |
| 82 | Relay Agent Information |
| 83 | Internet Storage Name Service |
| 85 | Novell Directory Services |
| 86 | Novell Directory Services |
| 87 | Novell Directory Services |
| 90 | Authentication |
| 93 | Client System Architecture |
| 94 | Client Network Device Interface |
| 95 | Lightweight Directory Access Protocol |
| 97 | UUID/GUID-based Client Identifier |
| 98 | Open Group's User Authentication |
| 100 | IEEE 1003.1 TZ String |
| 101 | Reference to the TZ Database |
| 108 | Number of seconds that DHCPv4 should be disabled |
| 109 | DHCPv4 over DHCPv6 Softwire Source Address Option |
| 112 | NetInfo Parent Server Address |
| 113 | NetInfo Parent Server Tag |
| 114 | DHCP Captive-Portal |
| 116 | DHCP Auto-Configuration |
| 117 | Name Service Search |
| 118 | Subnet Selection Option |
| 119 | DNS domain search list |
| 120 | SIP Servers DHCP Option |
| 121 | 设置无分类路由选项。该选项中包含一组无分类静态路由(即目的地址的掩码为任意值,可以通过掩码来划分子网),客户端收到该选项后,将在路由表中添加这些静态路由。 |
| 122 | CableLabs Client Configuration |
| 123 | GeoConf Option |
| 124 | Vendor-Identifying Vendor Class |
| 125 | Vendor-Identifying Vendor-Specific Information |
| 138 | CAPWAP Access Controller addresses |
| 139 | a series of suboptions |
| 140 | a series of suboptions |
| 141 | List of domain names to search for SIP User Agent Configuration |
| 142 | ANDSF IPv4 Address Option for DHCPv4 |
| 143 | This option provides a list of URIs for SZTP bootstrap servers |
| 144 | Geospatial Location with Uncertainty |
| 145 | Forcerenew Nonce Capable |
| 146 | Information for selecting RDNSS |
| 147 | The name of the peer DOTS agent. |
| 148 | N/4 IPv4 addresses of peer DOTS agent(s). |
| 150 | 设置TFTP服务器地址选项,指定为客户端分配的TFTP服务器的地址。 |
| 151 | Status code and optional N byte text message describing status. |
| 152 | "Absolute time (seconds since Jan 1, 1970) message was sent." |
| 153 | Number of seconds in the past when client entered current state. |
| 154 | "Absolute time (seconds since Jan 1, 1970) for beginning of query." |
| 155 | "Absolute time (seconds since Jan 1, 1970) for end of query." |
| 156 | State of IP address. |
| 157 | Indicates information came from local or remote server. |
| 158 | Includes one or multiple lists of PCP server IP addresses; each list is treated as a separate PCP server. |
| 159 | This option is used to configure a set of ports bound to a shared IPv4 address. |
| 160 | Previously assigned by [RFC7710]; known to also be used by Polycom. |
| 161 | Manufacturer Usage Descriptions |
OpenWrt之DNS设置的更多相关文章
- ubuntu的dns设置
ubuntu的dns设置为: dns-nameservers 8.8.8.8 注意不要少s
- Openwrt无线中继设置并访问外网
Openwrt无线中继设置并访问外网 本篇博文参考来自:http://blog.csdn.net/pifangsione/article/details/13162023 配置目标 主路由器使用AP模 ...
- 路由器动态DNS设置
路由器中的动态DNS设置非常的简单,只需要注册动态域名服务商的账号,然后在路由器中登录该账号就可以了 一.路由器动态DNS作用 无线路由器连接宽带上网后,路由器会从宽带运营商那里获取一个IP地址,这个 ...
- LINUX的DNS设置【转】
网卡DNS设置 用windos系统大家都知道,本地连接里面有一个DNS设置. 那么这个选项对应Linux系统的话就是在网卡配置文件,通过编辑vi /etc/sysconfig/network-scr ...
- linux下dns设置详解
DNS就是Domain Name System,它能够把形如www.21php.com这样的域名转换为211.152.50.35这样的IP地址;没有DNS,浏览21php.com这个网站时,就必须用2 ...
- 【openwrt】再设置
https://wiki.openwrt.org/zh-cn/doc/uci/network https://wiki.openwrt.org/zh-cn/doc/uci/wireless https ...
- linux下DNS设置以及解析顺序
1.编辑/etc/resolv.conf文件,添加如下语句: nameserver dns_ip(例如nameserver 8.8.8.8) 2.如/etc/nsswitch.conf中未包含启用DN ...
- Linux DNS 设置失败
在执行 yum install gcc 时 发现下载失败 ping www.baidu.com ping 不通 ping 百度的IP:220.181.111.188却能ping 通 由此证明是DNS的 ...
- CentOS IP DNS设置
1.CentOS 修改DNS 修改对应网卡的DNS的配置文件 # vi /etc/resolv.conf 修改以下内容 nameserver 8.8.8.8 #google域名服务器 nameserv ...
随机推荐
- npm 配置 registry 以及使用 nrm
由于众所周知的原因,我们的内网链接互联网时非常不稳定,速度慢而且经常下载失败.为了提高下载安装 npm 包的体验,很多人都会把 npm 的 registry 配置成国内镜像,我们一般用的比较多的就是淘 ...
- MySQL 在线开启&关闭GTID模式
MySQL 在线开启&关闭GTID模式 目录 MySQL 在线开启&关闭GTID模式 基本概述 在线开启GTID 1. 设置GTID校验ENFORCE_GTID_CONSISTENCY ...
- git连接远程仓库
1. 连接远程仓库 1.1. 创建仓库 在连接远程仓库之前,得先要确定你有一个远程仓库,到GitHub官网搞一个账户. 点右上角的加号然后"New repository"输入一个仓 ...
- Orika - 类复制工具
Orika 前言 类复制工具有很多,比较常用的有 mapstruct.Spring BeanUtils.Apache BeanUtils.dozer 等,目前我所在的项目组中使用的是 mapstruc ...
- 【Azure API 管理】在APIM 中添加 log-to-eventhub 策略,把 Request Body 信息全部记录在Event Hub中
问题描述 根据文档 https://docs.azure.cn/zh-cn/api-management/api-management-howto-log-event-hubs, 可以将Azure A ...
- Codeforces 708E - Student's Camp(前缀和优化 dp)
Codeforces 题目传送门 & 洛谷题目传送门 神仙 *3100,%%% 首先容易注意到 \(\forall i\in[1,m]\),第 \(i\) 行剩余的砖块一定构成一个区间,设其为 ...
- R语言与医学统计图形【7】低级绘图函数
R语言基础绘图系统 基础绘图包之低级绘图函数--气泡图.一页多图.背景网格.添加线条和散点.数学表达式 4.气泡图 symbols是高级绘图函数,可在图上添加标记,标记的形状包括:circles,sq ...
- 49-Reverse Linked List II
Reverse Linked List II My Submissions QuestionEditorial Solution Total Accepted: 70579 Total Submiss ...
- 使用SpringBoot实现文件的上传
使用SpringBoot实现文件的上传 springboot可以直接使用 org.springframework.web.multipart.MultipartFile 所以非常容易实现 一.首先是简 ...
- 使用GitHub Action进行打包并自动推送至OSS
GitHub Action 是 GitHub 于 2018 年 10 月推出的一个 CI\CD 服务. 官方文档:https://docs.github.com/cn/actions CI\CD 持续 ...