How to configure DNS in OpenWRT?

Setting up a DNS server in OpenWrt can be done through the web interface or by editing the configuration file. The following are the steps to set up a DNS server through the web interface:

  1. Access the web management interface of the OpenWrt router.
  2. Navigate to “Network” and then select “Interfaces”.
  3. Locate your WAN interface (usually labeled as WAN or WAN6) and then click on the edit button.
  4. Find the option “Use custom DNS servers” in the pop-up window and check the box.
  5. Enter the IP address of the DNS server you want to use in the “DNS servers” text box.
  6. Click on the “Save & Apply” button to save the changes.

To set up the DNS server by editing the configuration file, you can follow these steps:

  1. Access the OpenWrt router via SSH.
  2. Open the file /etc/config/network.
  3. Locate the relevant WAN interface configuration section (usually under ‘config interface ‘wan”).
  4. Add the following line in this section:
    option dns ‘IP address of the DNS server you want to use’
  5. Save the files and restart the network service.

After configuring the DNS server either through the web interface or editing the configuration file, you will need to restart the network service or reboot the router for the changes to take effect.

广告
Closing in 10 seconds
bannerAds