How to Enable DNS Server on Linux by Opening Port 53(linux开启53)

To enable DNS server on linux, you must open port 53 and allow access to the DNS server. In this tutorial, we will look at how to open port 53 and enable DNS server on Linux.

## Step 1: Check if the DNS Server is Installed

Before we enable the DNS server, we must first check if the DNS server is installed on the Linux server. To do this, open up a terminal window and enter the following command:

rpm -qa bind

This command will list all the installed packages with the name “bind”. If the packages are not found, you must install the DNS server.

## Step 2: Allow Access to the DNS Server

Once we have verified that the DNS server is installed, we need to allow access to the DNS server. To do this, we need to open port 53. To open port 53, we will use the `iptables` command. Enter the following command in the terminal window:

sudo iptables -A INPUT -p tcp --dport 53 -j ACCEPT

This command will open port 53 and allow traffic to the DNS server.

## Step 3: Enable the DNS Server

Once we have opened port 53, we need to enable the DNS server. To do this, we will use the `systemctl` command. Enter the following command in the terminal window:

sudo systemctl enable named

This command will enable the DNS server.

## Step 4: Start the DNS Server

Finally, we need to start the DNS server. To do this, enter the following command in the terminal window:

sudo systemctl start named

This command will start the DNS server and make it available for use.

## Conclusion

In this tutorial, we looked at how to enable DNS server on Linux. We looked at how to check if the DNS server is installed and how to open port 53 and enable the DNS server. Finally, we looked at how to start the DNS server. Hopefully, this tutorial was helpful and you were able to enable the DNS server on Linux.

版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《How to Enable DNS Server on Linux by Opening Port 53(linux开启53)》
文章链接:https://zhuji.vsping.com/155942.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。