Timetombs

泛义的工具是文明的基础,而确指的工具却是愚人的器物

66h / 116a
,更新于 2024-04-06T22:06:23Z+08:00 by   35f4f88

[计算机网络] DNS(Domain Name System)

版权声明 - CC BY-NC-SA 4.0

dnsmasq

https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

# /etc/dnsmasq.conf
# https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html
# 文件变化自动加载,无需重启

log-queries=extra
log-dhcp
log-facility=/log/dnsmasq.log



# DNS  - 上游DNS服务器配置文件
strict-order
resolv-file=/etc/dnsmasq.dns.upstream.conf
# DNS  - 本地DNS配置文件
addn-hosts=/etc/dnsmasq.dns.hosts
# 防止将没有域部分的本地名称转发到上游DNS服务器
domain-needed
# 防止将DNS反向查找查询转发到上游DNS服务器
bogus-priv


# DHCP -
dhcp-option=option:router,192.168.2.1
dhcp-option=option:netmask,255.255.255.0
# DHCP - DHCP静态分配
read-ethers
dhcp-hostsfile=/etc/dnsmasq.dhcp.hosts
# DHCP - DHCP动态分配
#        [tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>[,<netmask>[,<broadcast>]]][,<lease time>]
dhcp-range=192.168.2.240,192.168.2.254,255.255.255.0,12h

# dhcp-hostsfile=/etc/dnsmasq.dhcp.hosts
# https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html


# [<hwaddr>][,id:<client_id>|*][,set:<tag>][,tag:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]
# MAC地址需小写
00:15:5d:02:02:0b,192.168.2.22,deb1.vm.lan

# addn-hosts=/etc/dnsmasq.dns.hosts
# https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

# www.baidu.lan 解析到 192.168.1.2
192.168.2.201 www.baidu.lan

Reference

https://en.wikipedia.org/wiki/Domain_Name_System
https://en.wikipedia.org/wiki/Dnsmasq
https://openwrt.org/docs/guide-user/base-system/dhcp.dnsmasq

上一篇 : [计算机网络] Tool
下一篇 : [计算机网络] DoH(DNS over HTTPS)