Hostname To IP

Convert hostname to IP address. Free DNS lookup.

Rate this tool

How useful was this tool?

Hostname to IP Lookup

Enter a hostname in Hostname and click Get IPs. You get every address the name points to: all its IPv4 (A) and IPv6 (AAAA) addresses, with duplicates removed and listed in numeric order, each with a Copy button.

Each address also shows its TTL and its reverse DNS name. If the name is an alias, you see the whole chain of names it passes through, and short notes explain what the result means.

You don’t need to tidy the input first. The tool picks out the hostname from:

  • a URL such as https://www.example.com/blog/post
  • a host with a port such as example.com:8443
  • a name with a trailing dot such as example.com.
  • an email address
  • an internationalised name such as bücher.de

Service names with underscores, like _dmarc.example.com, are accepted too.

Both lookups (IPv4 and IPv6) run at the same time, with a 2.5-second limit, so a broken domain can’t leave the page hanging. Most lookups finish in well under a tenth of a second.

Example: google.com

Looking up google.com returned six IPv4 and four IPv6 addresses:

IPv4 (A)
142.251.110.100
142.251.110.101
142.251.110.102
142.251.110.113
142.251.110.138
142.251.110.139

IPv6 (AAAA)
2a00:1450:4001:c1f::65
2a00:1450:4001:c1f::66
2a00:1450:4001:c1f::71
2a00:1450:4001:c1f::8b

Next to each address is its TTL. Google sets five minutes (300 seconds) on these records, so the number counts down from there. Each address also shows its reverse DNS name: Google’s own, ending in 1e100.net. Because several addresses share one name, the notes call it round-robin.

A day earlier, the same lookup returned a different IPv4 set in the 142.251.20.x range. Both answers were correct. Google hands out different servers depending on when and where the question comes from, which is normal for large sites and anything behind a CDN.

When a name has several addresses, browsers pick one and fall back to another if it doesn’t respond. Many DNS servers also rotate the order on each lookup, so the traffic spreads across all of them.

Alias chains (CNAME)

Many names don’t hold addresses themselves. They’re aliases, CNAME records that say “look up this other name instead”. A shop’s shop.example.com usually points to shops.myshopify.com. A site on a CDN points to the CDN’s own hostname, which may point to another one in turn.

When the name you enter is an alias, the tool shows the whole chain, from the name you typed to the name that actually holds the addresses, and highlights that last one. The notes say what the host is an alias of. That’s often the quickest way to find out which hosting company or CDN serves a site.

Dangling aliases

Sometimes the chain leads nowhere: the alias points to a name that no longer has any addresses. The tool reports this as a dangling alias rather than a generic error.

It usually happens when a service was cancelled but its DNS record was left behind, such as an old app on a cloud platform or a deleted storage bucket. It’s worth fixing quickly, not just because the subdomain is broken. On some platforms, anyone can claim the abandoned name, and your subdomain will then show their content. This is known as a subdomain takeover. Delete the CNAME record, or point it somewhere you control.

TTL: when a change will show up

The TTL (time to live) next to each address is how many more seconds the resolver will keep this answer before asking again. After you change a DNS record, that number tells you how long, at most, this resolver will keep serving the old address.

Planning a move? Lower the TTL to a few minutes a day before the switch, so old answers expire quickly once you change the record. DNS Propagation Check shows what other public resolvers have meanwhile.

Reverse names and the notes

Each address shows its reverse DNS name. Usually that’s the hosting provider’s own name for the server, not the website’s, which helps you tell which company runs an address. IP to Hostname gives the full picture for any one address: whether the name points back, who manages its reverse DNS, its network and its location.

The notes point out what’s worth knowing:

  • The host is an alias, and of what.
  • Round-robin: several addresses share one name, and traffic is spread between them.
  • IPv4 only is common and fine. IPv6 only is a problem: visitors on networks without IPv6, still a large share, can’t reach the site at all.
  • No reverse names on any of the addresses, which is typical of CDNs and shared hosting.

When there’s no answer

Errors say why the lookup failed, because each cause has a different fix:

  • The name doesn’t exist. Check for a typo. Otherwise the domain may have expired, or the subdomain was never created.
  • The name exists but has no addresses. It only has other kinds of records, like _dmarc.example.com (a TXT record) or a subdomain used only for email. DNS Lookup shows what records it does have.
  • A broken alias. See dangling aliases above.
  • The nameservers didn’t answer in time. The domain’s DNS provider is down, or the domain points to nameservers that don’t host it. DNS Lookup shows which nameservers the domain uses.
  • The zone is failing. The nameservers answered with an error. A common cause is DNSSEC left switched on at the registrar after moving to a new DNS provider. Every resolver that checks DNSSEC then rejects the domain.
  • You entered an IP address. Use IP to Hostname, which looks up the other direction.

What the result can and can’t tell you

Behind a CDN, you get the CDN’s addresses. If a site uses Cloudflare or another CDN, the addresses belong to the CDN, not to the server the site actually runs on. Thousands of other sites may share them. To see who owns an address, check it with IP Information or ASN Lookup.

example.com and www.example.com are separate names. They can point to different addresses, and one can be broken while the other works. If a site loads with www but not without it (or the other way round), look up both.

It’s one resolver’s answer, at one moment. After changing a DNS record, use DNS Propagation Check to see whether resolvers around the world have the new value.

What it’s useful for

Confirming a server move

After you update your DNS, look up the domain and check both lists. The new server’s address should appear under IPv4, and under IPv6 too if the new server has one.

A leftover AAAA record still pointing at the old server is easy to miss. Visitors on IPv6 keep landing on the old site while everyone else sees the new one. If the new server has no IPv6 address, delete the old AAAA record rather than leaving it behind.

If the old addresses still show, the TTL tells you how long this resolver will keep them. If they’re still there after that, the record was probably edited at the wrong DNS provider.

Previewing a site on a new server before switching DNS

You can test a site on its new server before any visitor sees it. Add a line to your computer’s hosts file that maps the hostname to the new address:

203.0.113.10   example.com www.example.com

The file is at C:WindowsSystem32driversetchosts on Windows and /etc/hosts on Mac and Linux. Your browser now loads the site from the new server while everyone else still reaches the old one. Remove the line once DNS has been switched.

Firewall and allowlist rules

You may need a server’s address to allow it through a firewall or into a database. Two cautions:

  • CDN addresses are shared. If the hostname resolves to a CDN, allowlisting that address lets in far more than one site.
  • Outgoing addresses are often different. If you’re allowing a service to connect to you, the addresses it connects from are usually different from what its hostname resolves to. Use the IP list the provider publishes for that purpose.

Finding out where a site is hosted

The alias chain often names the host or CDN straight away. If it doesn’t, the reverse names usually do. Copy an address and check it with IP Information for the network and location.

FAQ

Why can’t I just type the IP into my browser?

Usually you’ll get an error page, a default server page or a certificate warning. A single address often serves many websites: shared hosting and CDNs work this way. The server uses the hostname your browser sends to decide which site to show. HTTPS certificates are also issued for names, not addresses, so the browser will flag a mismatch.

Which address does my browser use, IPv4 or IPv6?

If your connection supports IPv6 and the site has AAAA records, most browsers try IPv6 first. They switch to IPv4 within a fraction of a second if IPv6 doesn’t connect, a technique with the cheerful name “Happy Eyeballs.”

That quick fallback is why a broken IPv6 setup can go unnoticed for a long time. If you’ve just added AAAA records, test the site over IPv6 specifically.

Why does my computer get a different IP than this tool?

Different resolvers can get different answers, especially for sites on a CDN that hands out servers by location. Your computer may also still be holding an older answer, for up to its TTL. On Windows, ipconfig /flushdns clears it.

Does it work for names on my local network?

No. It checks public DNS only. Names that exist only inside your home or office network, like printer.local or an intranet server, can’t be resolved from the internet.

Can I do this from the command line?

Yes:

  • Windows: nslookup example.com
  • Mac or Linux: dig +short example.com for IPv4, or dig +short example.com AAAA for IPv6. dig +short also prints any alias names before the addresses, and dig example.com +noall +answer adds the TTLs.

Related Tools

Contact

Missing something?

Feel free to request missing tools or give some feedback using our contact form.

Contact Us