BuildWithMatija
Get In Touch
Build with Matija logo

Build with Matija

Modern websites, content systems, and AI workflows built for long-term growth.

Services

  • Headless CMS Websites
  • Next.js & Headless CMS Advisory
  • AI Systems & Automation
  • Website & Content Audit

Resources

  • Case Studies
  • How I Work
  • Blog
  • CMS Hub
  • E-commerce Hub
  • Dashboard

Headless CMS

  • Payload CMS Developer
  • CMS Migration
  • Payload vs Sanity
  • Payload vs WordPress
  • Payload vs Contentful

Get in Touch

Ready to modernize your stack? Let's talk about what you're building.

Book a discovery callContact me →
© 2026Build with Matija•All rights reserved•Privacy Policy•Terms of Service
  1. Commands
  2. Temporarily Override DNS for a Domain (macOS)

Temporarily Override DNS for a Domain (macOS)

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 mDNSResponder
Categories
Tools
Operating Systems
macos
Prerequisites
sudo access
Last Tested

6/24/2025

Tags
macOShosts filedns
Details

This command sequence allows you to override the DNS resolution of a domain on macOS by editing the `/etc/hosts` file.

Use this when:

  • You’ve changed DNS records but want to preview the old version of a site.
  • You want to access a specific server directly, bypassing current DNS records.

It’s especially useful for developers and site admins during migrations or staging setup.

Steps:

  1. Edit `/etc/hosts` and add: `3.65.168.47 laneks.si`
  2. Flush the DNS cache
  3. Open `https://laneks.si\` in your browser to see the version on the old IP.

To revert, remove the line from the hosts file and flush DNS again.

Safety Notes
  • Be careful not to remove or break existing entries in `/etc/hosts`.
  • This change only affects your local machine and is temporary.
  • Always flush DNS after modifying the hosts file, or changes won’t take effect.
  • Mistyping the IP or hostname can result in broken site access.
Related Commands
Other useful commands you might find helpful

Codex: add Chrome DevTools MCP via config.toml

Register the Chrome DevTools MCP server in Codex by adding the TOML block to ~/.codex/config.toml and restarting Codex.

[mcp_servers."chrome-devtools"]

Homebrew: fix codex stuck on old version (formula overrides cask)

Removes the outdated codex Homebrew formula (0.46.x) so the newly installed cask (0.47.x) becomes the active binary.

brew uninstall codex --formula

ripgrep: search TypeScript files excluding common dirs

Search recursively for <Button in TS/TSX files while excluding node_modules, src/components/contact, and src/components/ui.

rg "<Button" -g "*.ts*" -g '!*./node_modules/**' -g '!src/components/contact/**' -g '!src/components/ui/**'
Related Articles
Blog posts that might provide additional context

rclone Google Drive client_id: Create Your Own OAuth App

3/31/2026•Tools

B2B Lead Qualification: Stop Routing Leads by Hand

3/24/2026•Tools

PostgreSQL Replicas Explained: Patroni, Swarm & Kubernetes

3/23/2026•Tools