Change the IP address returned for blocked websites that is outside of the machine

I have looked at documentation and other questions on the forum but I can’t seem to figure out how I can respond with an IP that isn’t something hosted on the device.

This page shows the different options for blocking but all of them (besides the null ones) require a server that is hosted on the raspberry pi. Which one would I choose and how would I set the custom IP? I need exact details like what files to edit as I am not a Linux enthusiast. Thanks!

Blocking modes would work out of the box if you ticked the web interface option (for lighttpd) during initial installation. Note that showing a blocking page will work for HTTP only.

However, your question does not mention showing a blocking page at all.

As answers may depend on your aspired scenario:
What are you trying to achieve?

Say a user goes to google.com, I would want it to give them a different IP (ex 1.1.1.1).

Why would you want to redirect public domain names?

You could simply add a Local DNS Record, but this will likely break any page that references that domain.

I only used google as an example. If you don’t know, there is an app called HQ Trivia, and I want to redirect requests to their servers to my server because at my home i want to do a custom hq trivia event sort of thing.

For that app to work, you'd have to have a working copy of the HQ Trivia server software on a server in your network, or at least a replacement that implements the exact same API.

Otherwise, the app will just fail, regardless whether you manage to redirect access for all domains it wants to resolve.

Yes I have a digital ocean server and I am working on a 1:1 API, I just need to know how I can set the “blocking” IP to this.

This should work

Hm, alright. I see this option in the control panel now. Is there a way to do the same thing except instead of associating an IP address, associating another domain?

The next pihole version will (likely) include the option to add CNAME records. This should work for you.

Alright, thank you. I guess I'll have to wait for the next version.

The CNAME support will not solve the issue you want it to.

Changing the IP address for a server just doesn't work anymore. You need the private key used to create the TLS cert, and you won't be able to do anything without it. Nobody uses unencrypted channels now, especially something as high profile as HQ Trivia.

1 Like

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