Answer the question
In order to leave comments, you need to log in
How to specify the port in the hosts file?
I have a special stub on my VPN server (WireGuard) that runs on Apache2. Apache opens by internal private ip address on port 88, since port 80 is occupied by Pi-Hole. How can I make it so that for example: when you go to the site "google.com" not the site itself opens, but a stub? Is it possible to specify the following form of entry in the hosts file: 172.11.123.3:88 google.com www.google.com ?
Answer the question
In order to leave comments, you need to log in
No, you cannot do this in the host file.
most likely you need to redirect the traffic with a firewall or perhaps nginx proxy
That won't work. The hosts file is about dns and there is no concept of ports in dns.
You need to put your stub on port 80. In order for it to get along with pi-hole, it is necessary to scatter them over virtual hosts with different domains instead of ports.
Well, or transplant pi-hole to a non-standard port.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question