Este conteúdo não está disponível no idioma selecionado.
7.3.2. Configuring BIND and DNS
$domain
environment variable to simplify the process with the following command, replacing example.com
with the domain name to suit your environment:
domain=example.com
# domain=example.comdomain=example.com
$keyfile
environment variable so that it contains the file name for a new DNSSEC key for your domain, which is created in the subsequent step:
keyfile=/var/named/$domain.key
# keyfile=/var/named/$domain.key
dnssec-keygen
tool to generate the new DNSSEC key for the domain. Run the following commands to delete any old keys and generate a new key:
rm -vf /var/named/K$domain* pushd /var/named dnssec-keygen -a HMAC-SHA256 -b 256 -n USER -r /dev/urandom $domain KEY="$(grep Key: K$domain*.private | cut -d ' ' -f 2)" popd
# rm -vf /var/named/K$domain*
# pushd /var/named
# dnssec-keygen -a HMAC-SHA256 -b 256 -n USER -r /dev/urandom $domain
# KEY="$(grep Key: K$domain*.private | cut -d ' ' -f 2)"
# popd
Note
$KEY
environment variable has been set to hold the newly-generated key. This key is used in a later step.
Ensure that a key exists so that the broker can communicate with BIND. Use the rndc-confgen
command to generate the appropriate configuration files for rndc
, which is the tool that the broker uses to perform this communication:
rndc-confgen -a -r /dev/urandom
# rndc-confgen -a -r /dev/urandom
Ensure that the ownership, permissions, and SELinux context are set appropriately for this new key:
restorecon -v /etc/rndc.* /etc/named.* chown -v root:named /etc/rndc.key chmod -v 640 /etc/rndc.key
# restorecon -v /etc/rndc.* /etc/named.*
# chown -v root:named /etc/rndc.key
# chmod -v 640 /etc/rndc.key
7.3.2.1. Configuring Sub-Domain Host Name Resolution Copiar o linkLink copiado para a área de transferência!
dns-nsupdate
plug-in includes an example database, used in this example as a template.
Procedure 7.4. To Configure Sub-Domain Host Name Resolution:
- Delete and create the
/var/named/dynamic
directory:rm -rvf /var/named/dynamic mkdir -vp /var/named/dynamic
# rm -rvf /var/named/dynamic # mkdir -vp /var/named/dynamic
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Create an initial
named
database in a new file called/var/named/dynamic/$domain.db
, replacing domain with your chosen domain. If the shell syntax is unfamiliar, see the BASH documentation at http://www.gnu.org/software/bash/manual/bashref.html#Here-Documents.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 7.5. To Install the DNSSEC Key for a Domain:
- Create the file
/var/named/$domain.key
, where domain is your chosen domain:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the permissions and SELinux context to the correct values:
chgrp named -R /var/named chown named -R /var/named/dynamic restorecon -rv /var/named
# chgrp named -R /var/named # chown named -R /var/named/dynamic # restorecon -rv /var/named
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
/etc/named.conf
file.
Procedure 7.6. To Configure a New /etc/named.conf
File:
- Create the required file:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set the permissions and SELinux context to the correct values:
chown -v root:named /etc/named.conf restorecon /etc/named.conf
# chown -v root:named /etc/named.conf # restorecon /etc/named.conf
Copy to Clipboard Copied! Toggle word wrap Toggle overflow