Firefox only sees the first entry defined in /etc/hosts for 127.0.0.1. Basically, Firefox is not seeing the modifications to the DNS entries I've made in /etc/hosts. However, later I noticed that Safari is not seeing them as well. The hosts file is for DNS resolution. DNS resolve names to IP addresses, and has nothing to do with ports I am afraid. You will need to use something else in conjunction with the hosts file to redirect the port (Mangle the TCP header by altering the destination port). With iptables: Does MAC OS use iptables / netfilter (I didn't think it did).?
Hostbuddy is the easiest way to manage and update the /etc/hosts file on your Mac. Add new entries and turn on and off existing ones with one click. It's perfect for switching between staging and production servers or just for testing out your new website before it goes live.
New in Version 2.0
- Compatiable with macOS 10.12 Sierra - 10.15 Catalina
- Dark Mode
- Remotely hosted host files
- Compatible with VirtualHostX
![Update etc hosts mac Update etc hosts mac](/uploads/1/2/7/7/127729368/607014392.jpg)
What it Does
![Hosts Hosts](/uploads/1/2/7/7/127729368/654553200.jpg)
- Quickly add host entries without using the command line
- Turn on/off host groups with one click
- Won't overwrite your existing /etc/hosts file
- Compatible with VirtualHostX
- Automatically flushes your DNS cache