Question about DNS

I’m new to VyOS and have a question about DNS redirection. I want to know if there’s a feature or method in VyOS to modify DNS queries. For example, when a user tries to access domain.com (which normally resolves to IP 1.1.1.1), I want to redirect the request so it resolves to a different IP, like 2.2.2.2.

This is similar to modifying the /etc/hosts file on a Linux system. Does VyOS support something like this? If so, how can I configure it?

Thank you!

First of all, you need to ensure your clients are using your VyOS device as their DNS server. I assume you are assigning your clients IP Addresses via DHCP and handing out your routers LAN interface address as the DNS Server.

You can then simply do

set system static-host-mapping host-name rewrite.domain.com inet '2.2.2.2'

Could you please provide a detailed guide or manual on how to set up VyOS as a DNS server?

I would suggest familiarising yourself with the VyOS help pages.

There is even a quickstart guide.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.