How to Set a Static IP Address on a Mac

By default, your Mac obtains its IP address automatically from your router using a protocol called DHCP (Dynamic Host Configuration Protocol). This means that every time your Mac reconnects to the network, the router may assign it a different IP address. For most casual users, this is perfectly fine. However, if you are running a local development server, hosting a media server with Plex, configuring port forwarding for remote access, using network-attached storage, or troubleshooting persistent connectivity problems, a dynamically changing IP address becomes a serious inconvenience. Setting a static IP address ensures your Mac always uses the same address on your local network, making it reliably reachable by other devices and services.

Before You Begin: Information You Need

Before configuring a static IP address, you need to gather several pieces of information from your current network. The easiest way to find these is to check your current DHCP-assigned configuration:

  1. Click the Apple Logo in the menu bar and select System Settings.
  2. Click Network in the left sidebar.
  3. Click on your active connection (Wi-Fi or Ethernet).
  4. Click Details.
  5. Select the TCP/IP tab.

Note down the following values:

  • IP Address: Your currently assigned address (e.g., 192.168.1.105).
  • Subnet Mask: Usually 255.255.255.0 for home networks.
  • Router (Gateway): Your router’s IP address (e.g., 192.168.1.1).

You will also need your DNS server addresses. Navigate to the DNS tab in the same Details window to find them. Common options include your router’s IP address, or public DNS servers such as Google (8.8.8.8, 8.8.4.4) or Cloudflare (1.1.1.1, 1.0.0.1).

Choosing the Right Static IP Address

You cannot simply pick any random number. Your static IP must meet these requirements:

  • Same subnet as your router: If your router is 192.168.1.1, your static IP must be in the 192.168.1.x range (where x is between 2 and 254).
  • Outside the DHCP range: Most routers assign DHCP addresses within a specific range (e.g., 192.168.1.100 to 192.168.1.200). Your static IP should ideally fall outside this range to prevent address conflicts. Check your router’s admin page to see its DHCP range. A safe choice is often a high number like 192.168.1.210 or a low number like 192.168.1.10.
  • Not already in use: Before assigning the address, open Terminal and run ping 192.168.1.210 (replacing with your chosen IP). If you receive no response, the address is likely available.

How to Set a Static IP Address via System Settings

  1. Open System Settings from the Apple menu.
  2. Click Network in the left sidebar.
  3. Click on the network interface you want to configure — either Wi-Fi or Ethernet.
  4. Click Details.
  5. Select the TCP/IP tab.
  6. Click the dropdown menu next to Configure IPv4 and change it from Using DHCP to Manually.
  7. Enter the following values:
    • IP Address: Your chosen static IP (e.g., 192.168.1.210).
    • Subnet Mask: 255.255.255.0 (or whatever your network uses).
    • Router: Your router’s IP address (e.g., 192.168.1.1).
  8. Click OK to apply the changes.

Configuring DNS Servers

When you switch from DHCP to a manual IP configuration, macOS may clear your DNS settings. Without DNS servers configured, your Mac will be unable to resolve website addresses — meaning you will have network connectivity but websites will not load.

  1. While still in the network Details window, click the DNS tab.
  2. If the DNS Servers list is empty, click the + button to add entries.
  3. Add at least two DNS server addresses for redundancy:
    • Google DNS: 8.8.8.8 and 8.8.4.4
    • Cloudflare DNS: 1.1.1.1 and 1.0.0.1
    • Your router: Your router’s IP address (it will forward queries to your ISP’s DNS)
  4. Click OK to save.

Using public DNS servers like Cloudflare or Google is generally faster and more reliable than relying on your ISP’s default DNS. Cloudflare (1.1.1.1) is widely considered the fastest public DNS resolver available.

How to Set a Static IP Address via Terminal

If you prefer the command line, or if you need to script the configuration, you can set a static IP using the networksetup command in Terminal.

First, identify your network service name:

networksetup -listallnetworkservices

This will output a list such as:

Wi-Fi
Ethernet
Bluetooth PAN

Then, set the static IP configuration:

sudo networksetup -setmanual "Wi-Fi" 192.168.1.210 255.255.255.0 192.168.1.1

The three values after the service name are: IP address, subnet mask, and router (gateway).

Set the DNS servers:

sudo networksetup -setdnsservers "Wi-Fi" 1.1.1.1 1.0.0.1

To verify the configuration:

networksetup -getinfo "Wi-Fi"

Verifying Your Static IP Configuration

After applying the changes, verify everything is working correctly:

  1. Check your IP address: Open System SettingsNetwork and confirm the displayed IP matches your chosen static address.
  2. Test local connectivity: Open Terminal and ping your router: ping 192.168.1.1 — you should receive replies.
  3. Test internet connectivity: Ping an external address: ping 8.8.8.8 — this tests connectivity without relying on DNS.
  4. Test DNS resolution: Ping a domain name: ping google.com — if this fails but the previous test succeeded, your DNS configuration is incorrect.

Reverting to a Dynamic IP Address

If you need to switch back to an automatically assigned address:

  1. Go to System SettingsNetwork → select your connection → DetailsTCP/IP.
  2. Change Configure IPv4 back to Using DHCP.
  3. Click OK.

Or via Terminal:

sudo networksetup -setdhcp "Wi-Fi"

Your Mac will immediately request a new address from the router via DHCP.

Troubleshooting Common Static IP Problems

  • IP address conflict: If another device on the network is already using your chosen static IP, both devices will experience intermittent connectivity. Choose a different address outside the router’s DHCP range.
  • No internet access after configuration: Double-check that the Router (gateway) field is correct and that DNS servers are configured. Missing or incorrect DNS settings are the most common cause of connectivity issues after setting a static IP.
  • Cannot connect after reboot: Ensure the static IP is within the correct subnet. If your router uses 10.0.0.x addressing but you set a 192.168.1.x address, the Mac will be on a completely different network segment and will be unable to communicate.
  • Configuration resets after waking from sleep: This is uncommon on modern macOS but can occasionally occur with certain Wi-Fi drivers. Try disconnecting and reconnecting to the network, or re-applying the settings via Terminal.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.