因为工作测试需要,要在本机装一个环境,可以解析自己命名的域名,即域名->IP的映射服务。在网上找了下,都说是MaraDNS不错。也试了下,在本地配置是没有问题的。从官网上下载的是2-0-11.win32. 手机等测试设备指向内网的这个MaraDNS所在的机器IP做为手机上网的主DNS即可解析到自己命名的域名了。但,这时,你还想手机可以解析internet域名怎么办?官网上说MaraDNS不支持递归域名解析,要递归解析必须使用deakwood. 但是我测试了下DeadWood是可以递归域名解析,却不能配置成解析内网,所以要将MaraDNS与Deadwook一起配合用才可以。在网上找了很久,终于按如下的blog配置并测试成功:

原文:http://permalink.gmane.org/gmane.network.dns.maradns.general/2055

On 24 Aug 2011 at 10:42, Sam Trenholme wrote:
Hi,
thanks to Sebastiano and Sam.
I finally was able to set up the configuration for MaraDNS 2-0-3 and Deeawood 3.0.
I report the detials here for the benefit of MaraDNS users.
My problem was to be able to support on my intranet (which has its own DNS
servers that support both management of the intranet domain/subdomains and 
resolution for Internet domains) resolution for names belonging to the "example.org"
domain to IP addresses of machines on our intranet (these machines are not altered in
any way; so they still are part of the intranet domain. Our environment is Windows
based!).

I installed MaraDNS and Deadwood on my laptop (a Windows 7 Enterprise 64-bits)
following the instructions provided within the MaraDNS zip file.
I've not installed MaraDNS as a Windows service beacause I don't need a permanent
support for the "example.org" domain-2-IP resolution! Deadwood is, instead,
installed as a Windows service even if I changes its properties so that it doesn't start
automatically.

Having performed all the above instalaltion I've configured MaraDNS to bind on the
127.0.0.1 IP address, so that it cannot be directly accessed from other machines,
while Deadwood is bound to my laptop IP address (192.168.152.67 as indicated in
the config file below).

The MaraDNS config is the following:
    #
    # Bind MaraDNS to my laptop IP Address
    #
    # N.B.: this IP address has to be changed according to the IP address of the
    machine on which MaraDNS is running
    #
    ipv4_bind_addresses = "127.0.0.1"
    timestamp_type = 2
    random_seed_file = "secret.txt"

##
    # verbose_level: The number of messages we log to stdout. It can have five
    values:
    #   0     No messages except for the legal disclaimer and fatal parsing errors
    #   1     Only startup messages logged (Default level)
    #   2     Error queries logged
    #   3     All queries logged
    #   4     All actions adding and removing records from the cache logged
    #
    verbose_level = 1
    #
    #
    ## hide_disclaimer = "YES"
    #
    #
    # This section states where the data for the authoritative zone are held
    #
    csv2 = {}
    csv2["example.org."] = "db.example.org.txt"

as you can see I simply specify that MaraDNS has to manage the example.org
domain and be bound to the specified IP address.

The Deadwood config file instead is this one:
    #
    # This section instructs "Deadwood" to redirect DNS queries for non-
    authoritative zones to other DNS servers
    #
    # N.B.: the IP addresses in this section must be set according to the DNS
    configuration of your local Net
    #
    root_servers = {}
    root_servers["example.org."] = "127.0.0.1"
    root_servers["."] = "192.168.152.5,"
    root_servers["."] += "192.168.152.8,"
    root_servers["."] += "192.168.210.33"

#
    # Bind "Deadwood" to my laptop IP Address
    #
    # N.B.: this IP address has to be changed according to the IP address of the
    machine on which "Deadwood" is installed
    #
    bind_address="192.168.152.67"

#
    # Enable the provision of private IP addresses in DNS replies
    #
    filter_rfc1918=0
    #
    # The IPs allowed to connect and use the cache
    # N.B.: this value must be updated as requested
    recursive_acl = "192.168.152.0/24"

# The file containing a hard-to-guess secret
    random_seed_file = "secret.txt"

# This is the file Deadwood uses to read the cache to and from disk
    cache_file = "dw_cache_bin"

as you can see I've instructed Deadwood to redirect any example.org query to the
MaraDNS active on the 127.0.0.1 IP address and all other DNS queries to our
internal DNS servers (see root_servers["."] lines above).
Additionally I've instructed Deaddwood to bind to my laptop IP address and accept
DNS queries from all machines in our intranet.
All this is not sufficient if you don't specify the filter_rfc1918=0 line, instrcting
Deadwood to return IP private address in DNS replies. Indeed if you leave the
filter_rfc1918 default value (1), Deadwood will correctly pass example.org queries
to MaraDNS but will not return any IP address (if, as normal, you are using private
IP addresses for the example.org domain).

That' all. Thanks again to the people who provided hints to me.
Regards
   Domenico

> > My Deadwood configuration file is:
> >
> [snip]
> > bind_address="127.0.0.1, 192.168.88.3"
> > root_servers={}
> > root_servers["home.lan."]="192.168.88.4"
> > root_servers["."]="198.41.0.4,"
> [snip rest of ICANN root servers]
> > upstream_servers={}
> [Note: no other use of upstream_servers]
>
> Thanks for the report.  The issue here may be that combinations of
> root_servers and upstream_servers have some issues.  What may also
> work for Domenico is to use Deadwood 2.3 (which has really good
> upstream_servers support, but no root_servers support) instead of
> Deadwood 3.0.
>
> There appear to be two different bugs with Deadwood 3's upstream_servers:
>
> * upstream_servers has issues if one of the upstream servers gives us
> a SERVER FAIL
>
> * There may be problems in Deadwood configurations where both
> upstream_servers and root_servers are used.
>
> I will look in to these issues on September 5 (sooner if I can get
> sponsorship to fix these bugs).
>
> - Sam

同时在博客园中有一篇中文的博客不错,但他写的只适合MaraDNS解析内网,在这里也备注一下,以后忘记的时候可以参考下

http://www.cnblogs.com/scorpio0920/p/4480100.html

MaraDNS与DeadWood一起配置为本地机器提供小型化DNS服务的更多相关文章

  1. linux下如何查看当前机器提供了哪些服务

    答:使用netstat工具 在命令行下输入netstat -atun即可列出当前机器提供的服务 netstat各选项解析: -a 列出所有服务 -t 列出tcp相关 -u 列出udp相关 -n 以数字 ...

  2. Azure File Storage(一)为本地机器配置网络磁盘

    一,引言 本地机器硬盘空间不够了怎么办?重要文件不想存储在本地硬盘怎么办?加外接移动硬盘:或者换大容量存储设备,都是解决方案.但是每次都得携带,还得考虑当前设备是否支持外接硬盘. 1,这个时候 Win ...

  3. C#开发中使用配置文件对象简化配置的本地保存

    C#开发中使用配置文件对象简化配置的本地保存 0x00 起因 程序的核心是数据和逻辑,开发过程中免不了要对操作的数据进行设置,而有些数据在程序执行过程中被用户或程序做出的修改是应该保存下来的,这样程序 ...

  4. Dnsmasq安装与配置-搭建本地DNS服务器 更干净更快无广告DNS解析

    默认的情况下,我们平时上网用的本地DNS服务器都是使用电信或者联通的,但是这样也导致了不少的问题,首当其冲的就是上网时经常莫名地弹出广告,或者莫名的流量被消耗掉导致网速变慢.其次是部分网站域名不能正常 ...

  5. RedHat linux配置yum本地资源

    今天安装个linux平台的oracle数据库,在oracle检测的时候发现有些系统补丁包没有安装,手动rpm安装报有些关联包也没有安装,想想如果一个一个rpm的话累死人了要,所以想起用yum来进行安装 ...

  6. 配置rpm本地源及局域网环境下使用

    LInux个人开发过程中可以直接连到公网,所以想要安装各种软件时直接安装即可,但工作环境往往很让人头疼. 如果应用场景是没法链接外网的,公司内部绝大多数情况下是在自己的局域网下玩,这时候想装个软件是相 ...

  7. Dnsmasq安装与配置-搭建本地DNS服务器

    默认的情况下,我们平时上网用的本地DNS服务器都是使用电信或者联通的,但是这样也导致了不少的问题,首当其冲的就是上网时经常莫名地弹出广告,或者莫名的流量被消耗掉导致网速变慢.其次是部分网站域名不能正常 ...

  8. JBOSS安装与配置搭建本地项目环境(方便前端开发调式)

    JBOSS安装与配置搭建本地项目环境  什么是JBOSS? JBOSS是EJB的服务器,就像Tomcat是JSP服务器一样,就是服务器的一种. 环境搭建如下: 一:首先安装JDK,配置环境变量(PAT ...

  9. Maven settings.xml配置(指定本地仓库、阿里云镜像设置)

    转: 详解Maven settings.xml配置(指定本地仓库.阿里云镜像设置) 更新时间:2018年12月18日 11:14:45   作者:AmaniZ   我要评论   一.settings. ...

随机推荐

  1. Java学习-----单例模式

    一.问题引入 偶然想想到的如果把Java的构造方法弄成private,那里面的成员属性是不是只有通过static来访问呢:如果构造方法是private的话,那么有什么好处呢:如果构造方法是privat ...

  2. Eclipse代码注释模板修改

    /** * @ClassName: ${type_name} * @author: <font color="red"><b>ZF</b>< ...

  3. JQuery Easy Ui dataGrid 数据表格 ---制作查询下拉菜单

    JQuery Easy Ui dataGrid 数据表格 数据表格 - DataGrid 继承$.fn.panel.defaults,使用$.fn.datagrid.defaults重载默认值.. 数 ...

  4. DeDe内容调用img

    文章内容页调用缩略图方法如下两种.第一种没有大小设置.原图显示.第二种.可以设大小, {dede:field.image/} <img src="{dede:field.litpic ...

  5. 编写可维护的javascript代码--- 2015.11.22(注释)

    1.单行注释 // 这是一句单行注释 2.多行注释 /* 这里是代码 */     /*  这里都是注释 1232132  */      java的注释风格 /* * 另一段注释 * 这段注释包含2 ...

  6. ISO 7810 协议小结

    ISO 7816规定了Smart Card的传输协议分为 T=0 异步半双工字符传输协议 T=1 异步半双工块传输协议 T=0命令介绍 命令总是由接口设备启动,他以一个5字节的报头通知卡要做什么,然后 ...

  7. 龙杰ACR122S NFC读卡器

    龙杰智能卡有限公司(ACS,龙杰智能卡控股有限公司之全资附属公司,香港联交所上市编号:8210)创立于1995年,是亚太地区第一大.全球三大智能卡读写器供应商之一.ACS被<福布斯亚洲>杂 ...

  8. 【转】Android Activity和Intent机制学习笔记----不错

    原文网址:http://www.cnblogs.com/feisky/archive/2010/01/16/1649081.html Activity Android中,Activity是所有程序的根 ...

  9. windows客户端连接到samba服务器(如何使用samba)

    首先确保你的服务端已经配置好samba并成功启动服务,方法可参考此文章http://blog.csdn.net/linglongwunv/archive/2010/01/19/5212875.aspx ...

  10. bzoj3575[Hnoi2014]道路堵塞

    http://www.lydsy.com/JudgeOnline/problem.php?id=3575 总赶脚第二题总是比第三题难...... 好吧,这题一点思路都没有 听说用民科可以过掉大部分数据 ...