I would like my web server to refuse to answer queries to a domain name. In Iptables I have added to my iptables file:
-A INPUT -p tcp --dport 80 -m string --string "Host: mydomain.example" --algo bm -j REJECT
However, no rejection packet is received. I get a timeout from the client side. I would like the other end to be aware that the web server blocks this domain.
on the client side, right now I get:
MacBook-Pro-de-nicolas:~ nicolasguerinet$ curl mydomain.example
curl: (56) Recv failure: Operation timed out
I would like a "connection refused" error.