『尊米网』域名信息交流平台
设为首页 收藏本站
网站地图 RSS-订阅
反馈留言 高级搜索
尊米首页 | 域名新闻 | 域名知识 | 域名人物 | 域名标识 | 相关下载 | 信息专题 | 域名问答 | 域名经纪 | WHOIS查询 | Winindomain.com
 
╣当前位置╠
尊米首页 > 域名新闻 > 英文媒体报道 > 文章内容
Linux: Create Your Own Domain Name Server (DNS)
来源:Linux Today 发布时间:2007-12-03 03:39:16
欢迎您在线投稿(需先登陆),也可将您的新闻线索/稿件电子邮件至:editor@zunmi.com

One vital step to hosting your own domain is to set up a domain name server. One nice solution is to use Linux and the Berkeley Internet Name Domain(BIND) software. The primary job of a domain name server is to allow you and your users to associate your domains and subdomains with IP addresses. Oddly enough, even though the software is called BIND the daemon that you run is called named.

Generally speaking, you will need to have two servers (or at least two ip addresses) to act as nameservers. One will be the master nameserver where you set up all your settings and make all your changes and one will be the slave that will act as redundancy and will gather information from the master. Once you have set up your two name servers correctly you would associate them as your domain’s nameservers with the domain registrar (example: GoDaddy) that you used to register the domain.

For our purposes, I will be using the tools and syntax available on Redhat based Linux Distributions (Redhat, Fedora, CentOS, etc). The basic ideas and set up process would be similar if not the same on any other Linux Distribution.

Installation

# yum install bind bind-chroot

As you can see here we not only installed bind but we also installed a package called bind-chroot. This second package sets things up so that named runs in a chrooted environment (like a prison within a subdirectory so that it does not have access to anything but the contents of that subdirectory). You can install and use bind without the chrooted environment if you wish but I would not recommend it. With it you can minimize the damage if a cracker were to actually find and exploit a bug in named.

Configuring the Master Nameserver

Let’s say that we own the domain example.com and have 4 servers we plan to use for that domain; a webserver at 192.168.1.1, our master nameserver at 192.168.1.2, our slave nameserver at 192.168.1.3, and an email server at 192.168.1.4. It is entirely possible (and quite common) to have one server act as a webserver, email server, and a nameserver. However, for this example we’ll separate them to avoid confusion.


/var/named/chroot/etc/named.confDownload This File

options{
        directory       "/var/named/";
};
The only option we set (for now) is the directory for the zone files. Even though we set it to /var/named the files will actually be located in /var/named/chroot/var/named since named is chrooted to /var/named/chroot.
zone "example.com" {
        type    master;
        file    "example.com.zone";
        allow-transfer { 192.168.1.3; };
};
This is our domain’s zone definition. We point to the zone file that will hold the details and allow transfer to what will be our slave nameserver.
zone "1.168.192.in-addr.arpa" {
        type master;
        file "1.168.192.in-addr.arpa.zone";
};
This is the zone for reverse lookups to any of our IP addrsses that start with 192.168.1. A reverse lookup allows us to translate from ip address to domain name instead of just domain to IP.



Now let’s create the two zone files we defined in named.conf.


/var/named/chroot/var/named/example.com.zoneDownload This File

$TTL 900                                        ; 900 seconds default record (T)ime (T)o (L)ive in cache
In the first line of the zone file we define the default TTL (Time to LIve) for this zone. This basically tells computers how long to wait before checking again to see if any of the information they have already looked up has changed. This saves each and every computer that visits your website (or other server) from having to look up the ip address every single time it connects. It is generally wise to set this to long enough to cover a general browsing session but short enough so that the next time they come back they will catch if you did any changes to the dns records.
上一页12 3 下一页
上一篇:Dot-o-mator Makes Domain Naming Easy   下一篇:Microsoft Issues Domain-Related Security Alert
【免责声明】
以上文章由本站会员发布或网络转载,除色情、暴力及反政府等法律明确禁止内容以外,尊米网对其不承担法律责任。
[收藏] [推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]
发表评论
用户名: 新注册) 密码: 匿名评论 (未注册可直接匿名评论)
评论内容:(250字以内)
 §最新评论
进入主题评论页  
本月热点
相关新闻
·Internet overhaul wins approva
·Phoenix Clothing Brand BLaZa F
·.Asia Landrush Closes with Hal
·Internet agency to battle doma
·Alberta premier threatens to s
·Internet Polling Fails in N.H.
·Domain Front Running by Regist
·Network Solutions snarfing you
·How 2...Buy a domain name
·Registrar denies‘front-runnin
·Pompano domain name firm sold
·Moniker Acquired By Oversee.ne
赞助商广告
尊米首页 - 关于我们 - 本站动态 - 联系我们 - 媒体关注 - 网站地图 - 友情链接 - 原创投稿 - 帮助中心