1. Trang chủ
  2. » Công Nghệ Thông Tin

Secure PHP Development- P138 potx

5 162 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 99,46 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Testing makezoneRunning makezone is simple.. Here is a test run: ./makezone --add=zone --name=example.com --template=standard This creates the /var/named/example.com.zonezone file for ex

Trang 1

Testing makezone

Running makezone is simple Here is a test run:

./makezone add=zone name=example.com template=standard

This creates the /var/named/example.com.zonezone file for example.com using the standard zone template The contents of this zone file look like the following:

;

; This zone file is generated automatically by makezone script

; If you edit this file manually, the changes will be lost

; if you regenerate the zone again using makezone

;

$TTL 86400

$ORIGIN example.com

@ 1D IN SOA @ root (

01 ; serial 3H ; refresh 15M ; retry 1W ; expiry 1D ) ; minimum 1D IN NS 192.168.0.11

1D IN NS 192.168.1.254 1D IN MX 5 192.168.0.100 1D IN MX 10 192.168.0.101

ns 1D IN A 192.168.0.11 www 1D IN A 192.168.0.12 www IN CNAME apache.example.com

ftp 1D IN A 192.168.0.12 the /etc/named.conf has the following lines appended:

//

// Master zone configuration for example.com //

zone “example.com” IN {

type master;

file “example.com.zone”;

allow-update { none; };

};

656 Part IV: Using PHP for Sysadmin Tasks

Trang 2

Now, if the BIND server is restarted using the /etc/rc.d/init.d/named restartcommand, it loads the new zone

On some systems the named control script will be located in a different directory

You can test the new zone using the dig command.

For example:

dig www.example.com A

outputs something like the following:

; <<>> DiG 9.2.1 <<>> www.example.com A

;; global options: printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 50838

;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 3, ADDITIONAL: 0

;; QUESTION SECTION:

;www.example.com IN A

;; ANSWER SECTION:

www.example.com 26922 IN A 192.168.0.12

;; AUTHORITY SECTION:

example.com 86400 IN NS ns.example.com

;; Query time: 3469 msec

;; SERVER: 192.168.0.11#53(192.168.0.11)

;; WHEN: Sat Dec 14 03:03:58 2002

;; MSG SIZE rcvd: 127

Similarly, you can query about other records, as shown here:

The following will show mail exchanger (MX) records:

dig example.com MX

Chapter 18: BIND Domain Manager 657

Trang 3

The following will show name server (NS) records:

dig example.com NS

Summary

In this chapter, you learned how to develop a command-line PHP script that helps you manage DNS configuration on your Linux system Such scripts can take the tedium out of administering the several files that need updating when you add a domain Scripts such as this also maintain the integrity of the configuration by helping omit typos and other mistakes.

658 Part IV: Using PHP for Sysadmin Tasks

Trang 4

Internet Applications

CHAPTER 19

Web Forms Manager

CHAPTER 20

Web Site Tools

Part V

Ngày đăng: 07/07/2014, 07:20