To configure the DNS server for ubuntu12.04 Server Edition

Source: Internet
Author: User
Tags reverse dns

Operating System: ubuntu1204 Server Edition

DNS software: bind9

Newoa.qyjob.net points to the 168.168.168.96 IP Address

Run the following command to install

Sudo apt-Get install bind9 dnsutils bind9-doc

By default. Bind9 is configured as a DNS Cache Server. Therefore, you only need to add the DNS server address to the forwarding list.

Sudo Vim/etc/bind/naemd. conf. Options

Red is to be modified

[Plain]View plaincopy
  1. Options {
  2. Directory "/var/Cache/bind ";
  3. // If there is a firewall between you and nameservers you want
  4. // To talk to, you may need to fix the firewall to allow multiple
  5. // Ports to talk. See http://www.kb.cert.org/vuls/id/800113
  6. // If your ISP provided one or more IP addresses for stable
  7. // Nameservers, you probably want to use them as forwarders.
  8. // Uncomment the following block, and insert the addresses replacing
  9. // The All-0's placeholder.
  10. Forwarders {
  11. 210.21.4.130;
  12. };
  13. // ================================================ ========================================
  14. // If bind logs error messages about the root key being expired,
  15. // You will need to update your keys. See https://www.isc.org/bind-keys
  16. // ================================================ ========================================
  17. DNSSEC-validation Auto;
  18. Auth-nxdomain no; # conform to rfc1035
  19. Listen-on-v6 {Any ;};
  20. };

Configure the primary DNS Server

Create forward zone File

Sudo Vim/etc/bind/named. conf. Local

Add the following content

[Plain]View plaincopy
  1. Zone "qyjob.net "{
  2. Type master;
  3. File "db.qyjob.net ";
  4. };

Sudo CP/etc/bind/DB. Local/var/Cache/bind/db.qyjob.net
Sudo Vim/var/Cache/bind/db.qyjob.net[Plain]View plaincopy

  1. $ TTL 604800
  2. @ In SOA qyjob.net. root.qyjob.net .(
  3. 2; Serial
  4. 604800; refresh
  5. 86400; retry
  6. 2419200; expire
  7. 604800); negative cache TTL
  8. ;
  9. @ In NS localhost.
  10. @ In a 127.0.0.1
  11. Newoa in a 168.168.168.96
  12. @ In AAAA: 1

Sudo/etc/init. d/bind9 restart and test it to find that newoa.qyjob.net is already directed to DNS.

I do not want to perform reverse DNS for the time being. I want to find information for myself.

 

Http://blog.csdn.net/emtit2008/article/details/7854894

 

Step 1: Enable DNS caching and forwarding: edit/etc/bind/named. conf. option file, enable forwarders, and enter the correct upstream DNS server, that is, the server that the ISP gives in the format:

Forwarders {202.96.128.86 ;};

I. Bind main files

/Etc/bind/named. conf
/Etc/bind/named. conf. Local 2. instance {Host (a) ip192.168.1.122/24 www.hp6515b.com | host (B) ip192.168.1.193/24}
① Edit named. conf. Local
Add the following statements
// Reverse Region
Zone "1.168.192.in-ADDR. Arpa "{
Type master;
File "/etc/bind/db.192.168.1 ″;
};
// Forward Region
Zone "hp6515b.com "{
Type master;
File "/etc/bind/db.hp6515b.com ";
};

② Create the db.192.168.1 file under/etc/Bind
; Db.192.168.1
;
$ TTL 604800
@ In SOA www.hp6515b.com. root.hp6515b.com .(
1; Serial
604800; refresh
86400; retry
2419200; expire
604800); negative cache TTL
;
@ In NS www.hp6515b.com.
122 in PTR bbs.hp6515b.com.
193 in PTR xp.hp6515b.com.

③ Create the hp6515b.com file under/etc/bind; db.hp6515b.com
;
$ TTL 604800
@ In SOA www.hp6515b.com. root.hp6515b.com .(
1; Serial
604800; refresh
86400; retry
2419200; expire
604800); negative cache TTL;
@ In NS www.hp6515b.com.
WWW in a 192.168.1.122
BBS in cname WWW
Xp.hp6515b.com. In a 192.168.1.193

(4) Restart named
Sudo/etc/init. d/bind9 restart
The DNS configuration is complete at this location. You can try NSLookup.

Note: bind9 must be restarted after the configuration file is changed.
Iii. Precautions and skills
1. Ubuntu generally does not need root login to modify the file. How to create the file
Example: sudo VI/etc/bind/named. conf. Local
Create sudo VI/etc/bind/db.192.168.1
2. design the Domain Name Server under/etc/resolv. CONF/, for example, nameserver 192.168.1.122.

 

Http://www.chenjunhui.com/archives/34.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.