首页 > 代码库 > 自建mail服务器之一:dns解析

自建mail服务器之一:dns解析

1,maradns服务器安装和设置

mararc文件

# Win32-specific MaraRC file; this makes a basic recursive DNS# server.hide_disclaimer = "YES"ipv4_bind_addresses = "127.0.0.1,192.168.2.100"recursive_acl = "127.0.0.1/8"timestamp_type = 2csv2 = {}csv2["local.com."] = "db.lan.txt"# This is insecure until the secret.txt file is editedrandom_seed_file = "secret.txt"upstream_servers = {}upstream_servers["."] = "203.185.0.35,203.185.0.36"

db.lan.txt

test.%       192.168.2.100 ~%	MX	10 mail.% ~mail.%	192.168.2.100 ~

  

技术分享

 

2,配置系统dns服务器为127.0.0.1

技术分享

 

 3,测试

 

C:\Users\cutepig>e:\Users\cutepig\Downloads\maradns-2-0-13-win32\maradns-2-0-13-win32\askmara.exe Amail.local.com.
# Querying the server with the IP 127.0.0.1
# Question: Amail.local.com.
mail.local.com. +86400 a 192.168.2.100
# NS replies:
#local.com. +86400 ns synth-ip-c0a80264.local.com.
# AR replies:
#synth-ip-c0a80264.local.com. +86400 a 192.168.2.100

 

C:\Users\cutepig>nslookup test.local.com
Server: localhost
Address: 127.0.0.1

Name: test.local.com
Address: 192.168.2.100


C:\Users\cutepig>
C:\Users\cutepig>nslookup mail.local.com
Server: localhost
Address: 127.0.0.1

Name: mail.local.com
Address: 192.168.2.100


C:\Users\cutepig>nslookup -type=MX local.com
Server: localhost
Address: 127.0.0.1

local.com MX preference = 10, mail exchanger = mail.local.com
local.com nameserver = synth-ip-c0a80264.local.com
mail.local.com internet address = 192.168.2.100
synth-ip-c0a80264.local.com internet address = 192.168.2.100

 

自建mail服务器之一:dns解析