What's new

Rerouting domain request to another domain (not ip)

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

henlin

New Around Here
Hi!

I've been trying to find answers to this for a couple of days, and with quite a bit of trial and error, but still no solution.

What I want to accomplish:
When a client on my my network requests i.e. bing.com, I want asuswrt-merlin to redirect it to google.com ... I know how to redirect to an ip using dnsmasq.conf.add, but how can I get it to redirect to a domain(or url)? Can this be done with dnsmasq?

(reason for asking, is that a lot of sites don't accept direct ip access and just gives error message)
 
Hi!

I've been trying to find answers to this for a couple of days, and with quite a bit of trial and error, but still no solution.

What I want to accomplish:
When a client on my my network requests i.e. bing.com, I want asuswrt-merlin to redirect it to google.com ... I know how to redirect to an ip using dnsmasq.conf.add, but how can I get it to redirect to a domain(or url)? Can this be done with dnsmasq?

(reason for asking, is that a lot of sites don't accept direct ip access and just gives error message)

@henlin

Why are users on your network trying to browse by IP address? IP's are for machines. DNS is for us humans. If your goal is to redirect one domain to another, you could probably configure dnsmasq to point to a web server on your network that can do Virtual Name Based redirection. However, it would likely only be useful with just the domain name and not URI.

You might review my tutorial: [SOLUTION] OpenVPN Client Split Tunnel Reverse Proxy Web Traffic using Nginx, DNSMasq, and IPTables. Focus on the Nginx and DNSMasq portions of the tutorial and don't worry about the OpenVPN and IPTables sections.

Good Luck!


Gary
 
Thanks for the replies guys!

@garycnew At the moment, your script/configs looks a bit overwhelming. I've tried to understand what is going on, and I'm following, but I was still hoping to get an easier way of doing this.

@ColinTaylor I've tried the cname thing, but still running into somewhat the same problems. Both when using dnsmasq.conf.add and using alias, all browsers throws up warnings for whatever user is trying to access the website. In chrome the error message is something like "Your connection is not private" - I belive it was similar in edge and firefox. The specific error in chrome is ERR_CERT_COMMON_NAME_INVALID.

Is there a way to resolve this problem?
 
Looking in more detail at the posts that I linked to earlier I don't think that method is capable of doing what you want. As per post #2 in this thread you would have to use some sort of proxy server.
 
Last edited:
@henlin Google: nginx redirect to another domain
 
@garycnew Thanks! After a lot of additional searching, I've decided to install nginx and give it a try. I'm a bit afraid of the complexity - but if i solve it, I'll post an example in reply. ☺
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top