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 ...
随机推荐
- [bzoj1105]石头花园
首先$C/2=x_{max}+y_{max}-x_{min}-y_{min}=max(x_{max},y_{max})-min(x_{min},y_{min})+min(x_{max},y_{max} ...
- .NET Core中的鉴权授权正确方式(.NET5)
一.简介 前后端分离的站点一般都会用jwt或IdentityServer4之类的生成token的方式进行登录鉴权.这里要说的是小项目没有做前后端分离的时站点登录授权的正确方式. 一.传统的授权方式 这 ...
- 4、使用SetOperations(无序)操作redis(Set集合)
文章来源:https://www.cnblogs.com/shiguotao-com/p/10560599.html 方法 c参数 s说明 Long add(K key, V... values); ...
- nginx配置8081端口异常
1.为nginx配置8081端口,结果nginx报错. (nginx配置8081端口监听,通过查看日志,出现nginx: [emerg] bind() to 0.0.0.0:8081 failed ( ...
- Linux下Zabbix5.0 LTS + Grafana8.2.2图形可视化
Grafana是一款开源的可视化软件,可以搭配数据源实现一个数据的展示和分析:Grafana功能强大,有着丰富的插件,但Grafana默认没有zabbix作为数据源,需要手动给zabbix安装一个插件 ...
- 【5】蛋白质组学鉴定定量软件之PD
目录 1.简介 2.安装与配置 3.分析流程 4.结果 1.简介 PD全称Proteome Discoverer,是ThermoFisher在2008年推出的商业Windows软件,没错,收费,还不菲 ...
- confluence——实现
基于CentOS6.9 [root@localhost ~]# yum install mysql mysql-server -y [root@localhost ~]#yum install -y ...
- 4G网络 LTE、 FDD 和TD网络格式区别
1.LTE是long term evolution的缩写,即长期演进计划,是3GPP组织推出的移动通信3G技术向4G过渡的中间标准,并不是真正意义上的4G通信. 2.FDD是移动通信系统中使用的全双工 ...
- Django结合Echarts在前端展示数据
前言 最近在用Django写UI自动化测试平台,基本快要弄完了,但是首页只有项目列表展示,一直感觉很空旷,所以想把一些关键数据在首页展示出来. 这时就想到利用Echarts这个开源项目,但是Djang ...
- css系列,选择器权重计算方式
CSS选择器分基本选择器(元素选择器,类选择器,通配符选择器,ID选择器,关系选择器), 属性选择器,伪类选择器,伪元素选择器,以及一些特殊选择器,如has,not等. 在CSS中,权重决定了哪些CS ...