Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
YouTube Security VideosGoogle: Time for WNBA Playoffs 🔥(29.09.2026 um 15:31 Uhr)
••
YouTube Security VideosMozilla Developer: New Firefox design - Firefox 157(29.09.2026 um 15:30 Uhr)
•
Windows Tipps & SecurityGMKtec Evo X1 Pro im Test: Dieser Mini-PC ist ein echtes Kraftpaket(29.09.2026 um 15:30 Uhr)
•
Windows Tipps & Security140 Euro günstiger: Corsair Virtuoso Max Wireless fällt auf 159 Euro(29.09.2026 um 15:59 Uhr)
••
Sichere ProgrammierungGoogle-Analytics-Fehler lässt zahlreiche iPhone-Apps abstürzen(29.09.2026 um 15:39 Uhr)
•
Sichere ProgrammierungGiving an SRE Incident-Response Agent a Real Memory with Hindsight(29.09.2026 um 15:52 Uhr)
•••
YouTube Security VideosGoogle: Time for WNBA Playoffs 🔥(29.09.2026 um 15:31 Uhr)
••
YouTube Security VideosMozilla Developer: New Firefox design - Firefox 157(29.09.2026 um 15:30 Uhr)
•
Windows Tipps & SecurityGMKtec Evo X1 Pro im Test: Dieser Mini-PC ist ein echtes Kraftpaket(29.09.2026 um 15:30 Uhr)
•
Windows Tipps & Security140 Euro günstiger: Corsair Virtuoso Max Wireless fällt auf 159 Euro(29.09.2026 um 15:59 Uhr)
••
Sichere ProgrammierungGoogle-Analytics-Fehler lässt zahlreiche iPhone-Apps abstürzen(29.09.2026 um 15:39 Uhr)
•
Sichere ProgrammierungGiving an SRE Incident-Response Agent a Real Memory with Hindsight(29.09.2026 um 15:52 Uhr)
••
Intelligence View
⚡ tsecurity.de Intelligence

How to edit /etc/hosts without breaking your local setup

Most people open /etc/hosts, change one line, refresh the browser, and hope. That works until it does not. Then you spend twenty minutes on Permission denied, a forgotten DNS flush, or a commented line from last week that is still…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Most people open /etc/hosts, change one line, refresh the browser, and hope.



That works until it does not. Then you spend twenty minutes on Permission denied, a forgotten DNS flush, or a commented line from last week that is still active.



This is a simple workflow that keeps hosts edits boring.






What the hosts file does



When your machine resolves a name like myapp.test, it can use a local override before public DNS.



Common cases:




  • Point myapp.test to 127.0.0.1 for local work

  • Point a real domain at a staging IP before DNS cutover

  • Temporarily block a host with 0.0.0.0

  • Give services readable names instead of raw IPs



The idea is simple. The mess comes from how people edit and apply it.






A workflow that holds up






1. Do not treat /etc/hosts as your only copy



Keep a file you own:




~/dev/hosts/personal.hosts






Or one file per project / client. Edit that. Apply it on purpose.






2. Edit the copy, then copy it into place



macOS / Linux:




code ~/dev/hosts/personal.hosts
sudo cp /etc/hosts "/etc/hosts.bak.$(date +%Y%m%d-%H%M%S)"
sudo cp ~/dev/hosts/personal.hosts /etc/hosts






Windows: edit your copy, back up the live file, then replace:




C:\Windows\System32\drivers\etc\hosts






You need admin rights for the live file. That is normal.






3. Flush DNS every time you apply



Make this part of the apply step, not a later panic search.



macOS




sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder






Windows (Admin)




ipconfig /flushdns






Linux (systemd-resolved)




sudo resolvectl flush-caches









4. Verify in the terminal before the browser






ping -c 1 myapp.test
# Linux:
getent hosts myapp.test






Right IP in the terminal, wrong page in the browser? Stop rewriting hosts. Look at browser DNS, HTTPS, redirects, or HSTS.






5. Avoid two active lines for the same hostname



This breaks people constantly:




10.0.0.5    www.client.com
127.0.0.1 www.client.com






Pick one. Comment the other, or better, keep separate profile files and swap the whole file.






Example: local frontend + API






127.0.0.1   shop.test
127.0.0.1 api.shop.test






Frontend env:




NEXT_PUBLIC_API_URL=http://api.shop.test






API env:




APP_URL=http://api.shop.test






Then:




  1. Apply hosts

  2. Flush DNS

  3. Confirm with ping / getent

  4. Open the browser

  5. Only then debug CORS, cookies, or TLS



Hosts bugs and app bugs look the same in a tab. Split them.






Team onboarding



If your README says “paste these 12 lines into hosts,” configs will drift.



Better:




  • Commit a hosts.example

  • Add a short apply script

  • Say which environment the file is for (local, stEgin`, etc.)



Goal: new laptop works in a few minutes, not after three Slack threads.






Short version




  1. Edit a file you own

  2. Back up, then copy into the system hosts path

  3. Flush DNS

  4. Check resolution in the terminal

  5. Keep one active mapping per hostname



That is enough for most local and staging work. If you are changing hosts several times a day across clients, automate the swap with a script or a small hosts manager. The process above still matters either way.

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to edit /etc/hosts without breaking your local setup

Thematisch verwandte Begriffe: edit, etchosts, without, breaking · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-82973 | Improper neutralization of CRLF sequences in IMAP command construction i…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag