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 ...
随机推荐
- 一文带你吃透CLR垃圾回收机制
前言 今天我们来共同学习一下CLR的垃圾回收机制,这对我们写出健壮性的代码很有帮助,也许有人会认为多此一举,认为垃圾回收交给CLR就行,我不用关心这个,诚然,大多数情况下是这样的,但是,我们今天讨论的 ...
- 下一代的 3D Tiles 前瞻
下一代的 3D Tiles 前瞻 原文:Introducing 3D Tiles Next, Streaming Geospatial to the Metaverse 原文发布时间:2021年11月 ...
- lilypond进阶——用scheme修改乐谱细节
lilypond对乐谱内容的修改非常自由,用户可以自由根据需要做调整 调整一般都是用\override的命令,但是会比较冗长,码代码的时候比较麻烦 重新设置一个函数来概括命令,调用的时候使用的代码更短 ...
- 从零开始学Kotlin第七课
1.强制类型转换需要在后面加两个感叹号 2.如果需要在java代码调用kotlin的方法时候使用文件名+kt.方法 3.object 类名 是创建匿名内部类的写法 调用 传入class对象 4.在to ...
- 【基因组注释】GMAP安装使用问题
homology策略预测基因结构,下载了公共mRNA/CDS序列,考虑用gmap比对.本来是个很简单的脚本,但总是不那么顺利. 无论是用conda安装,还是源码安装较新版本,都存在问题. gmap_b ...
- python-django-事务使用
其中任何一个步骤失败都不行, 失败则回滚 在一对一的模型下 例如,用户基本信息和用户详细信息 必须两个一起添加用户信息才算成功 通过位置参数来实现 手动控制事务 def page_trans_hand ...
- python10-高阶函数
def use_filer(l): """ 获取指定列表/元组中的奇数 :param l: lsit/tuple :return: """ ...
- 使用systemd将iptables规则在docker启动后自动导入
编写systemd文件 $ sudo vi /etc/systemd/system/iptables-import.service # /etc/systemd/system/iptables-imp ...
- sed 修改文件
总结 正确的修改进文件命令(替换文件内容):sed -i "s#machangwei#mcw#g" mcw.txt 正确的修改追加进文件命令(追加文件内容):sed -i &quo ...
- javaWeb - 1 — servlet — 更新完毕
1.先来聊一些javaWeb相关的知识 简单了解一下:web的发展史 1).web就是网页的意思嘛 2).web的分类 (1).静态web 使用HTML.CSS技术,主要包括图片和文本 优点:简单,只 ...