Install bind in CentOS 7

bind is a DNS server. To install bind on CentOS 7, run

Enable bind to start on boot

Start bind

You can see status with

Setup firewall

You need to allow DNS ports UDP/TCP 53 in firewall. On CentOS 7, you can run

Configure bind

By default bind only listens to local IP, to make it accessable from outside, you need to edit named.conf

Find

Comment out those two lines by adding # at start of the lines.

We need our DNS server access query from anyone on internet. For this, find

Replace with

Since we only want our DNS server resolve domains hosted on our server, disable recursion.

Find

Replace with

Now restart bind with

Adding Domain to bind

To server a domain, you need to add the domain to bind. For this edit file

at end of the file, add

Now create zone file

Add following

Restart bind

You can verify domain is resolving with command

See bind

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *