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.
-j REJECT? – MadHatter Jul 23 '18 at 07:43iptablesruleset, I think HBruijn's suggestion, to do this at layer 4, is much the best. – MadHatter Jul 23 '18 at 09:07