文章同步发表自:
https://nevertired.nctu.me/2020/01/31/maradns-%e5%b0%8f%e5%9e%8b-open-source-dns-server/
MaraDNS https://maradns.samiam.org/index.html
简介
MaraDNS 是一款 open-source 、免费的 DNS server
优点
支援 windows 、 UNIX like小型轻量简单使用安全MaraDNS 下载 https://maradns.samiam.org/download.html
下载后 MaraDNS 分成三个部分
MaraDNS – DNS server
askmara – DNS queries (可供你测试)
Deadwood – DNS recursive
开始使用
执行 mkSecretTxt.exe
产生 secret.txt
使用记事本编辑 mararc 档案进行 MaraDNS server 设定
新增 DNS domain
範例
mararc 档案
ipv4_bind_addresses = "127.0.0.1"timestamp_type = 2random_seed_file = "secret.txt"## 新增网域 local.com 设定档 local.com.txtcsv2 = {}csv2["local.com."] = "local.com.txt"
新增一个 local.com.txt 档案
# 新增 A Name# % -> 带入网域 esx1.% = esx1.local.comesx1.% 192.168.43.11 ~# The format of a Domain Zone file# example.com. NS ns1.example.com. ~# ns1.example.com. 10.10.10.19 ~# example.com. 10.10.10.19 ~# www.example.com. 10.10.10.19 ~# example.com. MX 10 mail1.example.com. ~# mail1.example.com. 10.10.10.19 ~# Translated into English, the above lines say:# One name server for example.com is called ns1.example.com.# The IP for ns1.example.com is 10.10.10.19# The IP for example.com (in other words, the machine a web browser should hit if one selects http://example.com/) is 10.10.10.19# The IP for www.example.com is 10.10.10.19# The name of the machine which processes incoming mail, which has a priority of ten (lower priority numbers are more important), is called mail1.example.com.# The IP for mail1.example.com is 10.10.10.19## 更多细节请参考文件 https://maradns.samiam.org/tutorial/man.csv2.html
测试
启动 CMD
nslookup> server 127.0.0.1预设伺服器: [127.0.0.1]Address: 127.0.0.1> esx1.local.com伺服器: [192.168.43.206]Address: 192.168.43.206名称: esx1.local.comAddress: 192.168.43.11