The simplest way to find a website's IP address

The fastest way is to open Command Prompt (on Windows) or Terminal (on Mac), type a single command, and get the answer in seconds. On Windows, type nslookup example.com — replacing example.com with the actual website — and press Enter. The IP address appears in the results next to "Address:". On Mac, type dig example.com and look for the number in the "ANSWER SECTION" next to the domain name.

Both commands do the same thing: they ask your computer's DNS system (the one that translates website names into IP addresses) to look up what number belongs to that domain. You get back the IP address the website is currently using. This takes about one second and works for any website you can visit.

If you do not want to use the command line at all, you can also use an online tool. Search "IP lookup" or "what is my IP" in any search engine, and several free websites will appear. Paste the domain name into the box, click the button, and the IP address shows up. These tools do the same lookup your computer would do, just through a website instead of a command.

Key Takeaways

  • On Windows, open Command Prompt and type nslookup example.com to see the IP address next to "Address:".
  • On Mac, open Terminal and type dig example.com to see the IP address in the "ANSWER SECTION".
  • Online IP lookup tools work the same way but do not require you to use the command line.
  • The IP address you find is the current address the website uses, which can change if the owner moves their site to a different server.

Why you might want to know a website's IP address

Most of the time you do not need to know this. Your browser handles the translation from domain name to IP address automatically, and you never see the number. But there are a few real reasons you might want to look it up.

If you are troubleshooting a connection problem, knowing the IP address lets you test whether your computer can reach the server at all, separate from whether the domain name system is working. If you suspect a website is fake or spoofed, you can check whether the IP address matches what the real company uses. If you run your own website and need to point your domain name to the right server, you need to know the IP address of that server. And if you are setting up a home network and want to block certain sites, you may need their IP addresses to do it.

Understanding what the IP address tells you

The IP address you find is the address of the server (or servers) that hosts the website right now. Many large websites use multiple servers in different locations, so the IP address you get might be different depending on where you are in the world or what time you look it up. The website owner can also move their site to a new server and change the IP address without changing the domain name.

The IP address itself does not tell you much about the website's safety or legitimacy. A real company and a fake one both have IP addresses. What matters is whether the IP address belongs to the hosting company the real website uses, which you would need to research separately. If you are checking whether a website is legitimate, comparing its IP address to the real company's official website is more useful than the IP address alone.

How to find the IP address on Windows using Command Prompt

Open the Start menu and type cmd or command prompt. Click the Command Prompt process when it appears. A black window opens with a blinking cursor.

Type nslookup example.com, replacing example.com with the website you want to look up. For example, if you want to find the IP address of google.com, type nslookup google.com. Press Enter. The results appear in a few lines. Look for the line that says "Address:" — the number next to it is the IP address. It will look something like 142.250.185.46.

If you see multiple "Address:" lines, the first one is usually the main IP address. Some websites list multiple addresses because they use more than one server. You can close Command Prompt by typing exit and pressing Enter, or just clicking the X button.

How to find the IP address on Mac using Terminal

Open Spotlight by pressing Command + Space, type terminal, and press Enter. A white or black window opens with a prompt that ends in a dollar sign ($).

Type dig example.com, replacing example.com with the website you want to look up. Press Enter. The results fill the window with several sections. Look for the section labeled "ANSWER SECTION" — it usually appears about halfway down. The IP address is the number at the end of the line that shows the domain name. It will look something like 142.250.185.46.

If you see multiple lines in the ANSWER SECTION, the first one is usually the main address. You can close Terminal by typing exit and pressing Enter, or by clicking the red button in the top-left corner of the window.

Using online IP lookup tools instead

If you do not want to open Command Prompt or Terminal, online lookup tools do the same thing through a website. Search for "IP address lookup" or "DNS lookup" in Google, and several free tools appear at the top of the results. Popular ones include MXToolbox, WhatIsMyIPAddress, and DNSChecker.

Click on one of these sites, paste the domain name (like google.com) into the search box, and click the button to look up. The IP address appears in the results within a second or two. These tools are safe to use — they only perform the same DNS lookup your computer would do on its own. They do not access your personal information or require you to create an account.

The advantage of online tools is simplicity: you do not need to remember command syntax or open a terminal. The disadvantage is that you are relying on someone else's website to be working and accurate. The command line method on your own computer is faster and does not depend on any other service.

What to do if the lookup does not work

If you type the command correctly but get an error or no results, the most common cause is a typo in the domain name. Check that you spelled it exactly right, with no spaces before or after. Domain names are not case-sensitive, so Example.com and example.com are the same.

If you are sure the spelling is correct but still get an error, your internet connection might be having trouble reaching the DNS system. Try the lookup again in a few minutes. If it still does not work, restart your computer or try using an online lookup tool instead — that will tell you whether the problem is with your computer or your connection.

If the online tool also fails, the website itself might be down or the domain name might not exist. You can test this by trying to visit the website in your browser. If the browser also cannot reach it, the site is either offline or the domain name was typed wrong.

Frequently Asked Questions

Can I find the IP address of a website without using the command line?

Yes. Search for "IP lookup" in any search engine and use one of the free online tools. Paste the domain name into the box and click the button. The IP address appears in seconds. These tools do the same DNS lookup the command line does, just through a website instead.

Will the IP address change if the website moves to a different server?

Yes. If the website owner moves their site to a new hosting company or new server, the IP address changes. The domain name stays the same, but the number it points to is different. This is why comparing IP addresses to check if a website is real only works if you know what the real IP address should be.

Is it safe to look up a website's IP address?

Yes, completely safe. Looking up an IP address is the same thing your browser does automatically every time you visit a website. It is public information — anyone can look it up. It does not expose your personal information or put your computer at risk.

What if a website has multiple IP addresses?

Large websites often use multiple servers in different locations to handle traffic faster. When you look up the IP address, you might see several numbers listed. The first one is usually the main address. All of them are correct — they just point to different servers that host the same website.

Can I use the IP address to block a website on my home network?

Yes, some home routers let you block websites by IP address. You would log into your router's settings, find the blocking or filtering section, and add the IP address to a blocked list. However, this method is less reliable than blocking by domain name because websites can change their IP address, and one IP address might host multiple websites.