`
paofan
  • 浏览: 388811 次
社区版块
存档分类
最新评论

Howto: Setup a DNS server with bind

    博客分类:
  • SOG
阅读更多
Howto: Setup a DNS server with bind

Note: delete some comments.


After looking on Ubuntu forum for an easy step-by-step howto for instaling a DNS server, I decided the best idea would probably be to write this howto myself.... So, here it is!

Step 1: Install Ubuntu dapper, or use your WORKING installation.

Step2: Install bind 9:
Code:

sudo apt-get install bind9

Step 3: Configure the main Bind files. Usually, if you install Bind from the source code, you will have to edit the file named.conf. However, Ubuntu provides you with a pre-configured Bind, so we will edit another file:
Code:

sudo vi /etc/bind/named.conf.local

This is where we will insert our zones. By the way, a zone is a domain name that is referenced in the DNS server
Insert this in the named.conf.local file:
Code:

# This is the zone definition. replace example.com with your domain name
zone "example.com" {
        type master;
        file "/etc/bind/zones/example.com.db";
        };

# This is the zone definition for reverse DNS. replace 0.168.192 with your network address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
     type master;
     file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};

Ok, now, let's edit the options file:
Code:

sudo vi /etc/bind/named.conf.options

We need to modify the forwarder. This is the DNS server to which your own DNS will forward the requests he cannot process.
Code:

forwarders {
      # Replace the address below with the address of your provider's DNS server
      123.123.123.123;
};

Now, let's add the zone definition files (replace example.com with your domain name:
Code:

sudo mkdir /etc/bind/zones
sudo vi /etc/bind/zones/example.com.db

The zone definition file is where we will put all the addresses / machine names that our DNS server will know. You can take the following example:
Code:

// replace example.com with your domain name. do not forget the . after the domain name!
// Also, replace ns1 with the name of your DNS server
example.com.      IN      SOA     ns1.example.com. admin.example.com. (
// Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
)

// Replace the following line as necessary:
// ns1 = DNS Server name
// mta = mail server name
// example.com = domain name
example.com.      IN      NS              ns1.example.com.
example.com.      IN      MX     10       mta.example.com.

// Replace the IP address with the right IP addresses.
www              IN      A       192.168.0.2
mta              IN      A       192.168.0.3
ns1              IN      A       192.168.0.1

Now, let's create the reverse DNS zone file:
Code:

sudo vi /etc/bind/zones/rev.0.168.192.in-addr.arpa

Copy and paste the following text, modify as needed:
Code:

//replace example.com with yoour domain name, ns1 with your DNS server name.
// The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 1, as my IP address is 192.168.0.1.
@ IN SOA ns1.example.com. admin.example.com. (
                        2006081401;
                        28800;
                        604800;
                        604800;
                        86400
)

                     IN    NS     ns1.example.com.
1                    IN    PTR    example.com

Ok, now you just need to restart bind:
Code:

sudo /etc/init.d/bind9 restart

We can now test the new DNS server...
Step 4: Modify the file resolv.conf with the following settings:
Code:

sudo vi /etc/resolv.conf

enter the following:
Code:

// replace example.com with your domain name, and 192.168.0.1 with the address of your new DNS server.
search example.com
nameserver 192.168.0.1

Now, test your DNS:
Code:

dig example.com

分享到:
评论

相关推荐

    DNS与BIND.pdf

    ### DNS与BIND知识点详解 #### 一、DNS基础概念 **DNS**(Domain Name System)即域名系统,是一种用于实现域名到IP地址转换的核心服务。它通过一个分布式的数据库系统,帮助用户通过易于记忆的域名来访问互联网资源...

    C++ 11 std::function和std::bind使用详解

    C++ 11 std::function和std::bind使用详解 C++ 11 中引入了两个重要的功能:std::function 和 std::bind,它们都是基于 C++ 11 的新特性,用于实现函数指针的功能。下面将详细介绍这两个功能的使用和区别。 std::...

    DNS and Bind 第五版和Pro DNS and Bind 10

    《DNS and Bind》第五版与《Pro DNS and Bind 10》是DNS系统管理员和网络专业人士的必备参考资料,这两本书深入浅出地介绍了DNS(Domain Name System)与BIND(Berkeley Internet Name Domain)的原理、配置和管理。...

    jakarta.xml.bind-api-2.3.3-API文档-中文版.zip

    Maven坐标:jakarta.xml.bind:jakarta.xml.bind-api:2.3.3; 标签:bind、xml、api、jakarta、jar包、java、中文文档; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化...

    Pro DNS and BIND 10 英文版

    Pro DNS and BIND guides you through the challenging array of features surrounding DNS, with a special focus on BIND, the worlds most popular DNS implementation. This book unravels the mysteries of DNS...

    DNS与BIND中文第四版

    《DNS与BIND中文第四版》是一本详细介绍域名系统(DNS)和BIND(Berkeley Internet Name Domain)软件的经典著作。DNS是一个全球性的分布式数据库系统,它将易于记忆的域名地址转换为网络中计算机能够识别的IP地址。...

    dns_howto

    BIND支持多种DNS记录类型,如A记录、MX记录、CNAME记录等,同时也支持DNSSEC安全扩展。 #### 三、DNS服务器的重要性 对于网络工程师而言,理解和掌握DNS服务器的配置和管理至关重要。DNS服务器不仅是互联网的基础...

    DNS基础与BIND服务器配置(PPT).zip

    在深入理解DNS基础与BIND服务器配置之前,我们首先需要对DNS系统的基本工作原理有所了解。 DNS系统采用分布式数据库,由众多DNS服务器共同维护。当用户在浏览器中输入一个域名时,本地DNS客户端会向最近的DNS服务器...

    dns-and-bind

    根据提供的信息,“dns-and-bind.pdf”是一本详细讲解域名系统(DNS)与Berkeley Internet Name Domain(BIND)软件的专业书籍。这本书由Cricket Liu和Paul Albitz共同编写,ISBN号为1−56592−512−2,共502页,...

    linux dns Bind视频教程

    1. **BIND基础知识**:理解DNS系统的工作原理,包括DNS记录类型(A, AAAA, CNAME, MX, NS等)以及它们的作用。了解BIND软件的架构和配置文件结构。 2. **安装与配置BIND**:在Linux环境中安装BIND服务器软件,配置...

    DNS & BIND 4th edition

    《DNS & BIND 4th Edition》是一本深受IT专业人士欢迎的经典教材,主要涵盖了域名系统(DNS)和BIND(Berkeley Internet Name Domain)的基础知识、高级概念以及实际操作技巧。DNS是互联网上的关键基础设施,它负责...

    DNS与BIND 原版 第五版

    《DNS与BIND 原版 第五版》是由Paul Albitz和Cricket Liu共同编写的,这是一本深入解析互联网基础设施中至关重要的分布式主机信息数据库——DNS(Domain Name System)及其主要实现软件BIND(Berkeley Internet Name...

    DNS与BIND英文版(第四版)

    《DNS与BIND英文版(第四版)》是深入学习域名系统(DNS)和BIND软件的重要参考资料,对于IT行业的网络管理员、系统管理员以及网络技术爱好者来说,这本书无疑是一本宝贵的宝典。BIND,全称为Berkeley Internet Name...

    Configure-the-Linux-DNS-and-BIND-Server.rar_DNS Server_The Bind

    《配置Linux DNS与BIND服务器》是一本专注于DNS服务器在Ubuntu操作系统中配置的指南。DNS(Domain Name System)是互联网的一项核心服务,它将人类可读的域名转换为计算机可识别的IP地址。BIND(Berkeley Internet ...

    DNS与BIND 第5版

    根据提供的文件信息,“DNS与BIND 第5版”这本书主要聚焦于域名系统(DNS)和Berkeley Internet Name Domain(BIND)软件的深入讲解。虽然提供的内容有限,但我们可以基于书名和描述来推测这本书可能覆盖的一些关键...

    BIND9管理员参考手册-9.16.0.pdf

    文档详细介绍了DNS基础、BIND资源要求、名字服务器配置、高级DNS特征、从不安全转换到安全、BIND9对IPv6的支持以及BIND9配置参考等多个方面。 3. DNS基础: - 域和域名区:定义了域名空间的层次结构。 - 权威...

Global site tag (gtag.js) - Google Analytics