What Is My IP Address (Windows and Mac)
Learn what an IP address is, why it matters, and how to find it on Windows and Mac. DNScale explains how your IP connects your device to the internet.
What you'll learn
- Understand the difference between public and private IP addresses
- Find your IP address on Windows, Mac, and Linux using multiple methods
- Understand how DNS uses IP addresses to connect domain names to servers
- Learn how NAT works and why your public IP differs from your local IP
Every device connected to the internet has a unique identifier called an IP address. It's like your digital home address, allowing data to find its way to and from your device. Whether you're troubleshooting a connection issue, configuring a DNS record, or debugging network connectivity, understanding your IP address is essential.
What Is an IP Address?
An IP address (Internet Protocol address) is a series of numbers separated by dots (for IPv4) or colons (for IPv6) that identifies a device on a network. For example, an IPv4 address might look like 192.168.1.1, while an IPv6 address could look like 2001:0db8:85a3:0000:0000:8a2e:0370:7334.
These addresses allow devices to send and receive information across the internet or local networks. Without IP addresses, data wouldn't know where to go. Every DNS query ultimately resolves a domain name to an IP address ā that is the fundamental purpose of the Domain Name System.
Public vs. Private IP Addresses
This is one of the most important distinctions in networking. Your device likely has two different IP addresses:
Public IP Address
Your public IP address is assigned by your Internet Service Provider (ISP) and is visible to the rest of the internet. This is the address that websites, DNS servers, and other internet services see when you connect to them. All devices on your home or office network typically share a single public IP address.
# Find your public IPv4 address from the command line
curl -4 ifconfig.me
# Find your public IPv6 address
curl -6 ifconfig.me
# Alternative services
curl icanhazip.com
curl ipinfo.io/ip
dig +short myip.opendns.com @resolver1.opendns.comPrivate IP Address
Your private IP address is assigned by your local router and is only meaningful within your local network. Common private IP ranges are:
| Range | CIDR | Typical Use |
|---|---|---|
10.0.0.0 - 10.255.255.255 | 10.0.0.0/8 | Large enterprise networks |
172.16.0.0 - 172.31.255.255 | 172.16.0.0/12 | Medium networks |
192.168.0.0 - 192.168.255.255 | 192.168.0.0/16 | Home and small office networks |
Private addresses are not routable on the internet. Your router uses NAT (Network Address Translation) to map private addresses to your single public address.
Tip: When configuring A records in DNS, always use your public IP address, not your private address. Private addresses are not reachable from the internet.
How NAT Works
Network Address Translation (NAT) is the technology that allows multiple devices on a local network to share a single public IP address. Here is a simplified view:
- Your laptop (private IP
192.168.1.50) sends a request to a web server - Your router replaces the source address with its public IP (e.g.,
203.0.113.10) and tracks the connection in a NAT table - The web server responds to
203.0.113.10 - Your router checks its NAT table, translates the destination back to
192.168.1.50, and forwards the response to your laptop
NAT is necessary because IPv4 address space is limited to approximately 4.3 billion addresses ā far fewer than the number of connected devices worldwide. IPv6 eliminates the need for NAT by providing enough addresses for every device to have a globally unique address.
IPv4 vs. IPv6
The two main types of IP addresses are IPv4 and IPv6.
- IPv4 is the older format, using 32 bits, which allows for roughly 4.3 billion unique addresses. Example:
192.0.2.1 - IPv6 uses 128 bits, offering an almost unlimited number of unique addresses. Example:
2001:db8::1
Most internet users still use IPv4, but IPv6 adoption is increasing as the world moves toward larger, faster, and more efficient networking. In DNS:
- IPv4 addresses are stored in A records
- IPv6 addresses are stored in AAAA records
Your device may have both an IPv4 and an IPv6 address simultaneously (this is called dual-stack). When browsing the web, your browser typically prefers IPv6 when available.
How DNS Uses IP Addresses
The entire purpose of DNS is to translate human-readable domain names into IP addresses. Here is how IP addresses fit into the DNS ecosystem:
A Records (IPv4)
An A record maps a domain name to an IPv4 address:
example.com. 3600 IN A 192.0.2.1When someone types example.com in their browser, the DNS resolution process returns this IP address, and the browser connects to it.
AAAA Records (IPv6)
An AAAA record maps a domain name to an IPv6 address:
example.com. 3600 IN AAAA 2001:db8::1PTR Records (Reverse DNS)
PTR records do the reverse ā they map an IP address back to a domain name. This is used for verification purposes, particularly in email delivery where mail servers check that the sending IP's reverse DNS matches the domain in the email headers.
MX Records and IP Addresses
MX records point to mail server hostnames, which in turn resolve to IP addresses via A or AAAA records. The complete chain looks like:
example.com. MX 10 mail.example.com.
mail.example.com. A 192.0.2.10
mail.example.com. AAAA 2001:db8::10How to Find Your IP Address
On Windows
Public IP
Open Command Prompt or PowerShell and run:
curl ifconfig.meOr use nslookup:
nslookup myip.opendns.com resolver1.opendns.comPrivate IP
- Open the Start menu and type Command Prompt
- In the Command Prompt window, type
ipconfigand press Enter - Look for IPv4 Address under your active network adapter ā that's your local IP address
- Look for IPv6 Address for your local IPv6 address
Windows IP Configuration
Ethernet adapter Ethernet:
IPv4 Address. . . . . . . . . . . : 192.168.1.50
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1On Mac
Public IP
Open Terminal and run:
curl ifconfig.mePrivate IP
- Click the Apple menu and select System Settings
- Go to Network, then choose your active network connection
- Your IP address will appear under the Status or Details section
Or use Terminal:
# IPv4 address
ipconfig getifaddr en0
# All network interface details
ifconfig en0On Linux
Public IP
curl ifconfig.me
# or
dig +short myip.opendns.com @resolver1.opendns.comPrivate IP
# Modern Linux (using ip command)
ip addr show
# Show just the IPv4 address for the main interface
ip -4 addr show dev eth0 | grep inet
# Legacy method
ifconfig eth0Using dig for IP-Related DNS Queries
The dig command is invaluable for understanding how DNS maps domains to IP addresses:
# Find the IPv4 address for a domain
dig A example.com +short
192.0.2.1
# Find the IPv6 address
dig AAAA example.com +short
2001:db8::1
# Reverse DNS lookup ā find the domain for an IP
dig -x 192.0.2.1 +short
example.com.
# Check which nameservers are authoritative
dig NS example.com +short
ns1.dnscale.eu.
ns2.dnscale.eu.
# Trace the full resolution path
dig +trace example.comStatic vs. Dynamic IP Addresses
Static IP
A static IP address does not change. It is manually configured or permanently assigned by your ISP. Static IPs are used for:
- Web servers, mail servers, and other services that need a consistent address
- DNS A records that point to your infrastructure
- VPN endpoints and remote access
- SPF records that authorize specific IPs to send email
Dynamic IP
A dynamic IP address is assigned automatically by DHCP and may change periodically. Most home internet connections use dynamic IPs. If your public IP changes, any A records pointing to it will become stale until updated.
Tip: If you are hosting services on a dynamic IP, use a short TTL (e.g., 300 seconds) on your A records so that when your IP changes, DNS resolvers pick up the new address quickly. For a more robust solution, consider a CNAME record pointing to a dynamic DNS hostname.
IP Addresses and DNS Security
Your IP address is relevant to several DNS security considerations:
- SPF records list the IP addresses authorized to send email on behalf of your domain. If you add a new mail server, its IP must be included in your SPF TXT record
- CAA records control which certificate authorities can issue TLS certificates for your domain ā the certificate is bound to the domain, not the IP
- DNSSEC protects the integrity of DNS responses, ensuring that the IP address returned in an A record has not been tampered with
- Rate limiting on DNS servers often operates per source IP, which is why NAT can complicate DNS resolution for large networks behind a single public IP
Why Your IP Address Matters
Your IP address is more than just a number; it's a key part of how your device communicates with the internet. It helps websites identify your general location, allows servers to send information to you, and ensures your online traffic is correctly routed.
For network administrators and domain owners, IP addresses are essential for:
- Configuring DNS records (A, AAAA, PTR)
- Setting up email authentication (SPF records reference sending IPs)
- Firewall and access control rules
- Troubleshooting DNS resolution issues
- Performance monitoring and query analysis
Conclusion
Understanding your IP address helps you manage your online connections more effectively. Whether you're checking network settings, setting up DNS records, configuring email security, or troubleshooting connectivity issues, knowing the difference between public and private IPs, understanding NAT, and being able to find your IP on any platform are essential skills. DNScale provides tools and a globally distributed DNS network to help you stay connected and confident in your network setup.
Ready to manage your DNS with confidence?
DNScale provides anycast DNS hosting with a global network, real-time analytics, and an easy-to-use API.
Start free