OpenWrt之DNS设置

OpenWrt之DNS设置

0.前言

本文不涉及smartdns、adguardhome、dns防污染等内容,只介绍DNS的设置


1.WAN口

wan.png
wan2.png

保存&应用后 客户机发出dns解析请求后路由器用上面的dns回应


2.Lan口

进入openwrt的luci页面。在 网络>网卡>LAN 选择编辑

LANLAN

NUEXINI.LAN2

保存&应用后,路由器自身的dns解析请求 会使用 上面设置的DNS 来回应


3.LAN口DHCP选项

进入openwrt的luci页面。在 网络>网卡>LAN 选择编辑

NueXini

在 DHCP选项下 填入

6,223.5.5.5,119.29.29.29

效果如下:

DNS

该设置会修改连接到路由器LAN的DNS(类似于自定义电脑的DNS)

DNS


4.DHCP/DNS

dhcpdns.png


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 OPTIONMeaing
0None
1设置子网掩码
2"Time Offset in Seconds from UTC
3设置网关
4N/4 Timeserver addresses
5N/4 IEN-116 Server addresses
6设置DNS服务器
7N/4 Logging Server addresses
8N/4 Quotes Server addresses
9N/4 Printer Server addresses
10N/4 Impress Server addresses
11N/4 RLP Server addresses
12设置域名选项。
13Size of boot file in 512 byte chunks
14Client to dump and name the file to dump it to
15设置域名后缀选项。
16Swap Server address
17Path name for root disk
18Path name for more BOOTP info
19Enable/Disable IP Forwarding
20Enable/Disable Source Routing
21Routing Policy Filters
22Max Datagram Reassembly Size
23Default IP Time to Live
24Path MTU Aging Timeout
25Path MTU Plateau Table
26Interface MTU Size
27All Subnets are Local
28Broadcast Address
29Perform Mask Discovery
30Provide Mask to Others
31Perform Router Discovery
32Router Solicitation Address
33设置静态路由选项。该选项中包含一组有分类静态路由(即目的地址的掩码固定为自然掩码,不能划分子网),客户端收到该选项后,将在路由表中添加这些静态路由。如果存在Option121,则忽略该选项。
34Trailer Encapsulation
35ARP Cache Timeout
36Ethernet Encapsulation
37Default TCP Time to Live
38TCP Keepalive Interval
39TCP Keepalive Garbage
40NIS Domain Name
41NIS Server Addresses
42NTP Server Addresses
43Vendor Specific Information
44设置NetBios服务器选项。
45NETBIOS Datagram Distribution
46设置NetBios节点类型选项。
47NETBIOS Scope
48X Window Font Server
49X Window Display Manager
50设置请求IP选项。
51设置IP地址租约时间选项。
52设置Option附加选项。
53设置DHCP消息类型。
54设置服务器标识。
55设置请求参数列表选项。客户端利用该选项指明需要从服务器获取哪些网络配置参数。该选项内容为客户端请求的参数对应的选项值。
56DHCP Error Message
57DHCP Maximum Message Size
58设置续约T1时间,一般是租期时间的50%。
59设置续约T2时间。一般是租期时间的87.5%。
60设置厂商分类信息选项,用于标识DHCP客户端的类型和配置。
61设置客户端标识选项。
62NetWare/IP Domain Name
63NetWare/IP sub Options
64NIS+ v3 Client Domain Name
65NIS+ v3 Server Addresses
66设置TFTP服务器名选项,用来指定为客户端分配的TFTP服务器的域名。
67设置启动文件名选项,用来指定为客户端分配的启动文件名。
68Home Agent Addresses
69Simple Mail Server Addresses
70Post Office Server Addresses
71Network News Server Addresses
72WWW Server Addresses
73Finger Server Addresses
74Chat Server Addresses
75StreetTalk Server Addresses
76ST Directory Assist. Addresses
77设置用户类型标识。
78directory agent information
79service location agent scope
80Rapid Commit
81Fully Qualified Domain Name
82Relay Agent Information
83Internet Storage Name Service
85Novell Directory Services
86Novell Directory Services
87Novell Directory Services
90Authentication
93Client System Architecture
94Client Network Device Interface
95Lightweight Directory Access Protocol
97UUID/GUID-based Client Identifier
98Open Group’s User Authentication
100IEEE 1003.1 TZ String
101Reference to the TZ Database
108Number of seconds that DHCPv4 should be disabled
109DHCPv4 over DHCPv6 Softwire Source Address Option
112NetInfo Parent Server Address
113NetInfo Parent Server Tag
114DHCP Captive-Portal
116DHCP Auto-Configuration
117Name Service Search
118Subnet Selection Option
119DNS domain search list
120SIP Servers DHCP Option
121设置无分类路由选项。该选项中包含一组无分类静态路由(即目的地址的掩码为任意值,可以通过掩码来划分子网),客户端收到该选项后,将在路由表中添加这些静态路由。
122CableLabs Client Configuration
123GeoConf Option
124Vendor-Identifying Vendor Class
125Vendor-Identifying Vendor-Specific Information
138CAPWAP Access Controller addresses
139a series of suboptions
140a series of suboptions
141List of domain names to search for SIP User Agent Configuration
142ANDSF IPv4 Address Option for DHCPv4
143This option provides a list of URIs for SZTP bootstrap servers
144Geospatial Location with Uncertainty
145Forcerenew Nonce Capable
146Information for selecting RDNSS
147The name of the peer DOTS agent.
148N/4 IPv4 addresses of peer DOTS agent(s).
150设置TFTP服务器地址选项,指定为客户端分配的TFTP服务器的地址。
151Status code and optional N byte text message describing status.
152“Absolute time (seconds since Jan 1, 1970) message was sent.”
153Number 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.”
156State of IP address.
157Indicates information came from local or remote server.
158Includes one or multiple lists of PCP server IP addresses; each list is treated as a separate PCP server.
159This option is used to configure a set of ports bound to a shared IPv4 address.
160Previously assigned by [RFC7710]; known to also be used by Polycom.
161Manufacturer Usage Descriptions
  • 11
    点赞
  • 41
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值