Pretty Hostnames with /etc/hosts

When attacking or enumerating a target, typing raw IPs everywhere is clunky and error-prone. A simple, built-in trick is to use /etc/hosts to map an IP address to a friendly hostname so your tools, browser, and shell can use a memorable name.

Example mapping:

10.82.186.54 cybershield.nc3

This lets you visit http://cybershield.nc3 in your browser, curl cybershield.nc3, and point tools at the hostname instead of the IP.

What /etc/hosts Does

How to Add an Entry (macOS/Linux)

sudo sh -c 'printf "\n10.82.186.54 cybershield.nc3\n" >> /etc/hosts'
sudo vim /etc/hosts
# Add the line:
# 10.82.186.54 cybershield.nc3

Verify the Mapping

ping -c 1 cybershield.nc3
# Linux
getent hosts cybershield.nc3

# macOS
dscacheutil -q host -a name cybershield.nc3

Use It Everywhere

nmap -sV cybershield.nc3
gobuster dir -u http://cybershield.nc3 -w wordlist.txt
ffuf -u http://cybershield.nc3/FUZZ -w wordlist.txt

Tips & Best Practices

10.82.186.54 cybershield.nc3 shield nc3-shield
10.82.186.54 www.cybershield.nc3 admin.cybershield.nc3 api.cybershield.nc3

Troubleshooting

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Why This Helps in CTFs

Add the line, use the name, and enjoy cleaner, faster workflows.