Navigate
VyOS
Phone +1 323 488 2459
menu Close
  • Knowledgebase
  • News
  • Downloads
  • Contact Us
  • Register

  • or
  • Login
    Need a password reminder?
  • English
    Español
or
  • Portal
  • Knowledgebase
  • Services
  • DNS Forwarding in VyOS
  • Knowledgebase Read help articles
  • News News & updates
  • Downloads Browse our downloads
  • Contact Us We are here to help

DNS Forwarding in VyOS

Nicolas Fort
2021-08-20
0 Comments
in Services
Subscribe Download PDF

Use DNS forwarding if you want your router to function as a DNS server for local networks. The minimal information required for DNS Forwarding to work is:

  • Networks from which the router would accept DNS queries.
  • Router IP address, or addresses, in which the router would accept the DNS queries.
  • Name server's IP address that the router would use to forward DNS queries.

Commands to be executed on VyOs router to enable DNS Forwarding:

[email protected]# set service dns forwarding allow-from <IPv4 network | IPv6 network>
[email protected]# set service dns forwarding listen-address <IPv4 address | IPv6 address>
[email protected]# set service dns forwarding name-server <IPv4 address | IPv6 address>

Example1: router with LAN network 192.168.1.0/24 and IP 192.168.1.1. Also, 192.168.2.0/24 and IP 192.168.2.1/24 assigned to another VLAN, and forward DNS queries to Googles servers

[email protected]# set service dns forwarding allow-from 192.168.0.0/16
[email protected]# set service dns forwarding listen-address 192.168.1.1
[email protected]# set service dns forwarding listen-address 192.168.2.1
[email protected]# set service dns forwarding name-server 8.8.8.8
[email protected]# set service dns forwarding name-server 2001:4860:4860::8888

If forwarding for specific domains is required, use next command:

[email protected]# set service dns forwarding domain <domain> server <IPv4 address | IPv6 address>

For example, forwarding domain example.com queries to name server 192.168.2.20:

[email protected]# set service dns forwarding domain example.com server 192.168.2.20

Quick Jump
  • Knowledgebase
  • News
  • Downloads
  • Contact Us
Top
Helpdesk software provided by Deskpro