Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to understand Fedora DNS server client

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to understand the Fedora DNS server client, the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.

DNS has a lot to learn. Here we mainly introduce DNS server, including DNS server startup and so on. Fedora Core Linux plans to integrate into a new Fedora Project. In order to distinguish each host in the network, each host must be assigned a unique address, which is called the "IP address". But these numbers are difficult to remember, so they are replaced by "domain names". When a host wants to communicate with other hosts, it can use the host name to query the DNS server for the IP address of the host.

The entire DNS domain name system consists of the following four parts

1.DNS server domain name space

2. Resource record

3.DNS server

4.DNS server client

Setting up DNS server under Linux is usually realized by using Bind program. Bind, which stands for Berkeley Internet Name Domain Service, is an open source software that implements a DNS server. Bind was originally a graduate project funded by the University of Berkeley (Berkeley) by DARPA in the United States, but after years of change and development, it has become the most widely used DNS server software in the world. At present, most of the DNS servers on Internet are built with Bind.

DNS server type:

1.Master Server master server

2.Slave Server secondary server / slave server

3.Caching only Server cache server

4.Forwarder Server forwarding server

5.Stealth Server secret server

DNS BIND area Type:

Type description

Master main DNS server area

Slave slave DNS server zone, controlled by the master DNS server zone

Stub is similar to the slave zone, but only saves the name of the DNS server

Forward forwards any challenge request to another server

Hint root DNSInternet server set

Common BIND configuration statements and options:

Statement description

BIND comments of C language style

/ / comments on C++ grammatical style BIND comments

# Notes BIND comments of Unix shell and Perl system style

Acl defines a list of IP address matches

Include contains a file

Key indicates the key information used for identification and authorization

Logging specifies the content and source of log information recorded by the named server

Default values for configuration options and other statements for the Options global server

Control declares the control channel used by ndc software tools

Server sets configuration parameters for a server

Trusted-keys defines DNS SEC keys that are pre-configured into the server and trusted

Zone defines an area

Type indicates a region type

File specifies a zone file

Directory specifies the area file directory

Forwarders lists the DNS servers on which the host request will be forwarded

Masters lists the DNS server hosts used as slave servers

Allow-transfer specifies which host is allowed to accept requests for zone delivery

Allow-query specifies which host is allowed to ask questions

Motify allows the master server to notify the slave server when the master zone data allows changes and updates

Resource record type:

Type description

A host address, mapping host name to IP

NS Local Domain authorized name Server

The name of the CNAME specification, used to comment on the alias of the host

SOA authorization begins, starting the DNS server entry in the domain file, specifying the name server for the domain and other features (such as dots and serial numbers)

WKS known service description

PTR pointer record, perform reverse domain name access, map IP address to host name

RP text string containing pin information about the host

HINFO host information

MINFO email or mailing list information

MX mail exchanger, delivered to remote sites of domain mail servers

TXT text string, usually host information

Installation

[root@localhost] # rpm-Q bind

[root@localhost /] # cd / media/Fedora\ 8\ i386\ DVD/Packages/

[root@localhost Packages] # find. -name "bind*"

Bind-9.5.0-16.a6.fc8.i386.rpm

Bind-chroot-9.5.0-16.a6.fc8.i386.rpm

Bind-libs-9.5.0-16.a6.fc8.i386.rpm

Bind-utils-9.5.0-16.a6.fc8.i386.rpm

The virtual directory of the BIND program is / var/named/chroot/

/ etc/named.conf is actually / var/named/chroot/etc/named.conf

For example, / var/named/, its real path is / var/named/chroot/ var/named/

[root@localhost Packages] # rpm-ivh bind-libs-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-libs-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

Package bind-libs-9.5.0-16.a6.fc8 is already installed

[root@localhost Packages] # rpm-ivh util-linux-ng-2.13-3.fc8.i386.rpm

Warning: util-linux-ng-2.13-3.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

Package util-linux-ng-2.13-3.fc8 is already installed

[root@localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Error: Failed dependencies:

Libmysqlclient.so.15 is needed by bind-9.5.0-16.a6.fc8.i386

Libmysqlclient.so.15 (libmysqlclient_15) is needed by bind-9.5.0-16.a6.fc8.i386

Libodbc.so.1 is needed by bind-9.5.0-16.a6.fc8.i386

Libpq.so.5 is needed by bind-9.5.0-16.a6.fc8.i386

Mysql is needed by bind-9.5.0-16.a6.fc8.i386

Postgresql is needed by bind-9.5.0-16.a6.fc8.i386

UnixODBC is needed by bind-9.5.0-16.a6.fc8.i386

[root@localhost Packages] # rpm-ivh mysql-libs-5.0.45-4.fc8.i386.rpm

Warning: mysql-libs-5.0.45-4.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

1:mysql-libs [100%]

[root@localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Error: Failed dependencies:

Libodbc.so.1 is needed by bind-9.5.0-16.a6.fc8.i386

Libpq.so.5 is needed by bind-9.5.0-16.a6.fc8.i386

Mysql is needed by bind-9.5.0-16.a6.fc8.i386

Postgresql is needed by bind-9.5.0-16.a6.fc8.i386

UnixODBC is needed by bind-9.5.0-16.a6.fc8.i386

[root@localhost Tuxtools] # rpm-ivh unixODBC-2.2.12-5.fc8.i386.rpm

Warning: unixODBC-2.2.12-5.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

1:unixODBC [100%]

[root@localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Error: Failed dependencies:

Libpq.so.5 is needed by bind-9.5.0-16.a6.fc8.i386

Mysql is needed by bind-9.5.0-16.a6.fc8.i386

Postgresql is needed by bind-9.5.0-16.a6.fc8.i386

[root@localhost Tuxtools] # rpm-ivh postgresql-libs-8.2.7-1.fc8.i386.rpm

Warning: postgresql-libs-8.2.7-1.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

1:postgresql-libs [100%]

[root@localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Error: Failed dependencies:

Mysql is needed by bind-9.5.0-16.a6.fc8.i386

Postgresql is needed by bind-9.5.0-16.a6.fc8.i386

[root@localhost Tuxtools] # rpm-ivh postgresql-8.2.7-1.fc8.i386.rpm

Warning: postgresql-8.2.7-1.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

1:postgresql [100%]

[root@localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Error: Failed dependencies:

Mysql is needed by bind-9.5.0-16.a6.fc8.i386

[root@localhost Packages] # rpm-ivh mysql-5.0.45-4.fc8.i386.rpm

Warning: mysql-5.0.45-4.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

1:mysql [100%]

[root@localhost Packages] # rpm-ivh bind-9.5.0-16.a6.fc8.i386.rpm

Warning: bind-9.5.0-16.a6.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 4f2a6fd2

Preparing... [100%]

1:bind [100%]

[root@localhost] # rpm-Q bind

Bind-9.5.0-16.a6.fc8

Start the DNS server and test the loopback after installation

[root@localhost etc] # / etc/rc.d/init.d/named start

Start named: [OK]

[root@localhost etc] # nslookup

> localhost

Server: 127.0.0.1

Address:127.0.0.1#53

Name: localhost

Address: 127.0.0.1

> 127.0.0.1

Server: 127.0.0.1

Address:127.0.0.1#53

1.0.0.127.in-addr.arpa name = localhost.

> exit

[root@localhost etc] # / etc/rc.d/init.d/named stop

Stop named: [OK]

Modify the network configuration script file (/ etc/sysconfig/network-scripts/ifcfg-eth0):

[root@localhost ~] # cd / etc/sysconfig/network-scripts/

After modification

# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]

DEVICE=eth0

BOOTPROTO=static

HWADDR=00:0C:29:65:21:05

BROADCAST=192.168.1.255

IPADDR=192.168.1.6

NETMASK=255.255.255.0

NETWORK=192.168.1.1

ONBOOT=yes

Modify the local domain name server IP address (/ etc/resolv.conf):

Domain jw.com

Nameserver 192.168.1.6

Presentation / usr/share/doc/bind-9.5.0/sample

[root@localhost etc] # cp named.conf named.conf.old

Modify the named.conf file (/ etc/named.conf):

Listen-on port 53 {127.0.0.1;}

Listen-on-v6 port 53 {:: 1;}

In Fedora 8, port 53 is opened by default only on the loopback address 127.0.0.1 and:: 1 (the loopback address of IPV6). If you want to open port 53 on all addresses, you should change it to:

Listen-on port 53 {any;}

Listen-on-v6 port 53 {any;}

Allow-query {localhost;}

By default, the DNS server in Fedora 8 only allows the 127.0.0.1 client (that is, the local machine) to initiate a query. Generally, we need to allow everyone to query, so it should be modified to:

Allow-query {any;}

Set the main area (/ etc/named.conf):

To facilitate configuration and reduce errors, we copied the loopback / etc/named.rfc1912.zones file from the system (127.0.0.1) to the named.conf file and modified it, copying the following from the named.rfc1912.zones file

Zone "localhost" IN {

Type master; Note: type and file are two required options, and the type entry is used to indicate the area type (master,slave,stub,forward,hint)

File "named.localhost"; Note: used to indicate the name of the area file

Allow-update {none;}; Note: zone replication is not allowed

Zone "1.0.0.127.in-addr.arpa" IN

Type master

File "named.loopback"

Allow-update {none;}

}

Modify to

Zone "jw.com" IN {

Type master

File "jw.com.zone"

Allow-update {none;}

}

Zone "1.168.192.in-addr.arpa" IN {

Type master

File "1.168.192.arpa"

Allow-update {none;}

}

Create a zone file in (/ var/named):

[root@localhost ~] # cd / var/named/

To facilitate configuration and reduce errors, we copy the system (127.0.0.1) loopback files (forward zone files / var/named/named.localhost proposed zone files / var/named/named.loopback)

[root@localhost named] # cp named.localhost jw.com.zone

[root@localhost named] # cp named.loopback 1.168.192.arpa

Contents of the original jw.com.zone file

$TTL 1D

@ IN SOA @ rname.invalid. (note: authorization begins, specify name server

0; serial adds and modifies the corresponding sequence number

1D; refresh is the refresh interval of SOA information

1H; retry is the frequency of contact with the authorized server

1W; expire is the interval between saving information about the zone from the server without updating it

3H); minimum is the record of survival time in the region

NS @ Note: authorized name servers in this domain

A 127.0.0.1 Note: host address, mapping host name to IP address

AAAA:: 1

Contents of the file modified by jw.com.zone

$TTL 1D

Jw.com. IN SOA dns.jw.com. Admin.jw.com. (

2008041201; serial

1D; refresh

1H; retry

1W; expire

3H); minimum

Jw.com. IN NS dns.jw.com.

Dns.jw.com. IN A 192.168.1.6

Www.jw.com. IN A 192.168.1.6

Bbs.jw.com. IN A 192.168.1.6

Blog.jw.com. IN A 192.168.1.6

Mail.jw.com. IN A 192.168.1.6

Jw.com. IN MX 10 mail.jw.com.

Aaa.jw.com IN CNAME www.jw.com.

Contents of the original 1.168.192.arpa file

$TTL 1D

@ IN SOA @ rname.invalid. (

0; serial adds the corresponding serial number when it is modified

1D; refresh is the refresh interval of SOA information

1H; retry is the frequency of contact with the authorization server

1W; expire is the interval between saving information about the zone from the server without updating it

3H); minimum is the record of survival time in the region

NS @

PTR localhost. Note: pointer record, perform reverse domain name access, map IP address to host name

Contents of the file modified by 1.168.192.arpa

$TTL 1D

1.168.192.in-addr.arpa. IN SOA dns.jw.com. Admin.jw.com. (

2008041201; serial

1D; refresh

1H; retry

1W; expire

3H); minimum

1.168.192.in-addr.arpa. IN NS dns.jw.com.

6 IN PTR dns.jw.com.

6 IN PTR www.jw.com.

6 IN PTR bbs.jw.com.

6 IN PTR blog.jw.com.

6 IN PTR mail.jw.com.

Modify the group to which the file belongs:

[root@localhost named] # chgrp named jw.com.zone

[root@localhost named] # chgrp named 1.168.192.arpa

[root@localhost ~] # / etc/rc.d/init.d/named start

Start named: [OK]

test

[root@localhost ~] # nslookup

> localhost

Server: 192.168.1.6

Address:192.168.1.6#53

Name: localhost

Address: 127.0.0.1

> 127.0.0.1

Server: 192.168.1.6

Address:192.168.1.6#53

1.0.0.127.in-addr.arpa name = localhost.

> www.jw.com Note: test host address A resource record

Server: 192.168.1.6

Address:192.168.1.6#53

Name: www.jw.com

Address: 192.168.1.6

> dns.jw.com

Server: 192.168.1.6

Address:192.168.1.6#53

Name: dns.jw.com

Address: 192.168.1.6

> 192.168.1.6 Note: test reverse parse pointer PTR resource record

Server: 192.168.1.6

Address:192.168.1.6#53

6.1.168.192.in-addr.arpaname = www.jw.com.

6.1.168.192.in-addr.arpaname = bbs.jw.com.

6.1.168.192.in-addr.arpaname = blog.jw.com.

6.1.168.192.in-addr.arpaname = dns.jw.com.

> set type=ns Note: test the name server NS resource record

> jw.com

Server: 192.168.1.6

Address:192.168.1.6#53

Jw.com nameserver = dns.jw.com.

Set type=mx note: test mail exchanger MX resource records

> jw.com

Server: 192.168.1.6

Address:192.168.1.6#53

Jw.com mail exchanger = 10 mail.jw.com.

> set type=soa Note: SOA resource records of the test initiation authority

> jw.com

Server: 192.168.1.6

Address:192.168.1.6#53

Jw.com

Origin = dns.jw.com

Mail addr = admin.jw.com

Serial = 2008041201

Refresh = 86400

Retry = 3600

Expire = 604800

Minimum = 10800

> set type=cname note: test alias CNAME resource record

> aaa.jw.com

Server: 192.168.1.6

Address:192.168.1.6#53

Aaa.jw.com.jw.com canonical name = www.jw.com.

> exit

Turn off the DNS server service

[root@localhost ~] # / etc/rc.d/init.d/named stop stop named:

On how to understand the Fedora DNS server client to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report