Force your Mac to resolve a domain to a specific IP by modifying the /etc/hosts file
sudo nano /etc/hosts
# Add the following line at the bottom:
3.65.168.47 laneks.si
# Then flush DNS cache:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder6/24/2025
This command sequence allows you to override the DNS resolution of a domain on macOS by editing the `/etc/hosts` file.
Use this when:
It’s especially useful for developers and site admins during migrations or staging setup.
To revert, remove the line from the hosts file and flush DNS again.