[cc lang='bash']
\$ yum install python-twisted
\$ vi test.zone
\$ twistd dns --pyzone test.zone --interface 127.0.0.1 --port 53053
\$ netstat -tulnp | grep 53053
tcp 0 0 127.0.0.1:53053 0.0.0.0:* LISTEN 14391/python
udp 0 0 127.0.0.1:53053 0.0.0.0:* 14391/python
\$ dig test +short @127.0.0.1 -p 53053
192.168.10.10
[/cc]
test.zone
[cc lang='bash']
zone = [
SOA(
# For whom we are the authority
'test',
# This nameserver's name
mname = "localhost",
# Mailbox of individual who handles this
rname = "root",
# Unique serial identifying this SOA data
serial = 2012071401,
# Time interval before zone should be refreshed
refresh = "1H",
# Interval before failed refresh should be retried
retry = "1H",
# Upper limit on time interval before expiry
expire = "1H",
# Minimum TTL
minimum = "1H"
),
NS('test', '127.0.0.1'),
A('test', '192.168.10.10'),
CNAME('www.test', 'test'),
CNAME('ftp.test', 'test'),
MX('test', 0, 'mail.test'),
A('mail.test', '192.168.10.20')
]
[/cc]