Pi-Hole: url to other url redirect with unbound

Hello forum users,

Maybe someone can help me. I want to redirect from one URL to another with Unbound. I tried the whole thing with CName. But apparently that doesn't work. What must the line in the conf look like exactly?

local-zone: "xxxxx.com" redirect
local-data: "xxxxx.com CNAME xxxxx.com."

thank you

Greeting

Would you care to explain what you are trying to achieve?

There may be easier ways than adding CNAME records.

Hello,

I just want to redirect INTERNAL in the network when calling a URL to another URL INTERNAL with unbound.

So you have e.g. a fancyphone.local sitting at 192.168.0.10., and now you want smartphone.local to point to fancyphone.local's IP address as well?

If it's not the redirect itself you are after, how about creating a Local DNS Record for the intended target IP address in Pi-hole instead?

Hello,

Thanks for your help. I want to go to a url, for example video.com, when I unbound the url video.com. is redirected. I want a point behind the url. Since it is
is an FQN domain, I can bypass advertising.

And I wanted to do that with Unbound. But I can't get it.

(It's not necessary to quote full replies - use the Reply button for referring your answer to a previous post in its entirety.)

If that means you are trying to point video.com to something like video.com/mainPage/video-1, that would be beyond the scope of DNS.

DNS is only concerned with domain names (i.e. video.com in the example). Anything in a URL behind the domain (i.e. /mainPage or /mainPage/video-1) is completely invisible to DNS.

1 Like

The desired behavior is

video.com --> video.com. (see the dot)

In that case, I doubt that CNAME resolution would help, as the URL in the browser would remain untouched. It's only DNS resolution that will be one step longer before it returns the final IP.
You can't rewrite URLs in DNS - it's totally lacking understanding of URLs.

Dont mean to bump an old thread,
But what about something like this?

video.com --> video.net
or

video.com --> books.com

Just need to redirect to a root domain.
I have no idea how to go about this, and CNAME's are not working either.

That's working fine with a local CNAME record, isn't it?

http://pi.hole/admin/cname_records.php

No, as a CNAME (nor any other DNS request) would never affect the URL, and that's what's asked for here:
Changing
https://www.youtube.com/watch?v=DuB8VUICGqc
to
https://www.youtube.com./watch?v=DuB8VUICGqc
(quoting from yubi's link above).

That could be addressed via URL rewriting, e.g. by a browser plugin.

Indeed. I was using the search and wasn't aware of the actual original intention of the OP. What I was trying to achieve (and that works perfectly - from DNS side, the application problem of that service still remains but that's another story) was exactly what Local CNAME Records can do: