Redirect a website

Hello,

This is my first post in this community :slight_smile:
I have installed pi-hole and I would like to block a website (for instance www.gmx.fr) and redirect to my local IP (192.168.0.XX) (with a 'Website not allowed")
I have tried to do it editing like this

sudo nano /etc/pihole/pihole-FTL.conf

BLOCKINGMODE=NULL
;; QUESTION SECTION:
;gmx.fr. IN ANY

;; ANSWER SECTION:
gmx.fr. 2 IN A 192.168.0.XX

I saved and then restarted :
sudo service pihole-FTL restart

It is not working, I still can access to https://www.gmx.fr.

Could someone kindly help me ?

Thanks,

Victor

That actually, is the response you get when you try to dig gmx.fr
It's not a parameter you can config :slight_smile:

What you need to do is to edit /etc/pihole/pihole-FTL.conf from BLOCKINGMODE=NULL to BLOCKINGMODE=IP and that, will return a (custom if needed) page residing on the Pi-hole with information.

See our official guide here Blocking mode - Pi-hole documentation for more info.

Hello @RamSet,

Thanks for your response.
So, if my understanding is correct, my /etc/pihole/pihole-FTL.conf file contains only BLOCKINGMODE=IP ?
And then on the blacklist page of pihole, I added:
www.gmx.fr ( Exact blocking)
and (^|.)gmx.fr$ (Wildcard)

But I can still access to www.gmx.fr
What am I missing ?

Correct.

Did you reload pihole-FTL and cleared the cache ?

This setting can be updated by sending SIGHUP to pihole-FTL ( sudo killall -SIGHUP pihole-FTL ).

I just made a sudo killall -SIGHUP pihole-FTL and a sudo reboot, and nothing changed, I still can access to gmx.fr

Are you using the IP of Pi-hole as your sole DNS ?

If you have any other DNS' then your request might bleed through that.

What is the output of nslookup gmx.fr on a client?

Ah, it actually blocks from other clients, and I have this line on the log
2019-12-12 18:36:16 A gmx.fr 192.168.0.26 Blocked (regex/wildcard)

But now how can I redirect to my local IP ?

@RamSet and thanks again for helping me!

No problem.

Not quite sure I understand this properly.

You mean to redirect to the IP of your client or to the IP of Pi-hole, with a splash page ?

When a client goes to gmx.fr, I want them to be redirected automaticaly to my local page (192.168.0.XX)

If you have BLOCKINGMODE=IP in the config, you should be able to see a page every time you access a blocked domain.

That page resides on your device hosting Pi-hole.

I have BLOCKINGMODE=IP on my /etc/pihole/pihole-FTL.conf
I can access to gmx.fr on my PC but other clients cannot access (= can't open website)

It's weird

And still, I have this
2019-12-12 18:55:35 A www.gmx.fr 192.168.0.26 Blocked (regex/wildcard) - (0.3ms)
So,it's correctly blocked but I cannot do a redirection. @RamSet

Try this

server : pihole-raspberry
adress: 192.168.0.YY

and some lines about reply with not authority

gmx.fr uses https so you can't intercept or present your own content in it's place.

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