How to access a website running on localhost from a mobile

You open your laptop in an airport, at a coffee shop, or perhaps in your hotel or conference room. You sit down to work, select the correct Wi-Fi network, và ... Nothing. Your Wi-Fi icon may show it's connected, but your browser says You are not connected to the mạng internet no matter how hard you try. That popover login screen just never loads.

Bạn đang xem: How to access a website running on localhost from a mobile

We've all been there. As a remote team that has spent a lot of time working from coworking spaces and coffee shops, we've wasted far more time than we'd like to admit trying to lớn get online.

There's no magic button khổng lồ connect khổng lồ coffee shop, hotel, and airport Wi-Fi, but these tricks get us connected most of the time.

→ Odds are you'll need these tips when your Wi-Fi isn't working, so be sure to tải về our Wi-Fi cheat sheet at the over of this tutorial lớn have a copy of these tips when you need them.

The best option: Connect khổng lồ a secure network


When possible, always opt for a secure network, often shown with a padlock

The typical problem with public Wi-Fi is the login screen not showing up. That's only a problem only with open, public, unsecured Wi-Fi networks.

If you connect to an open network at your friend's house, say, typically you won't need a password and can just start browsing the mạng internet directly. With a coffee shop or airport Wi-Fi, though, often you need to lớn create an account or enter a code from a receipt before browsing the full internet. You have to vì that on a custom login screen, and that's what often just won't load.

Get the blog in your inbox

The best solution is also the most secure one: opt for only encrypted Wi-Fi connections. Typically shown with a padlock beside their name in your Wi-Fi menu, encrypted networks ask for a password in a standard dialog like the one above. Once you've entered the password, you'll typically never need to vì chưng it again on that device as your computer will remember it.

Secure Wi-Fi connections are always easier khổng lồ log in to, but they also địa chỉ cửa hàng a security benefit. On a public Wi-Fi network, by default, anything you enter on an unsecured, non-HTTPS site could be viewed by anyone else on the network. Encrypted networks with WPA2 passwords are far harder khổng lồ attack & thus your data is likely safer.

Some networks offer both an encrypted & public network option, và you could log in lớn either one. If so, choose the encrypted network.

No encrypted network available? These tips should help you get that pesky open network login screen to lớn load.

1. Turn off alternative 3rd buổi tiệc ngọt DNS servers


You might speed up your internet with a different DNS server—but not when connecting khổng lồ public Wi-Fi.

If there's one other tip to remember, it's this—the trick that usually gets login pages lớn load: turn off your alternate DNS server.

DNS servers, or domain name servers, match domain name names such as lớn its server's IP address—which makes it much easier to lớn visit websites than typing in

If you don't know where lớn change your DNS settings, you're likely fine; your computer by mặc định automatically picks up a DNS vps from the Wi-Fi router, which is what the public Wi-Fi expects you lớn use automatically. And that's good, at least with public Wi-Fi: your login page is more likely lớn load, and you won't need these tips.

If you've ever added Google DNS, OpenDNS, or any other alternative DNS to lớn your network settings, though, that may be your problem. Many public Wi-Fi networks use their DNS hệ thống to tell your computer which login page to lớn open—which doesn't work when you're using an alternative DNS server.

To fix that, just xuất hiện your DNS settings and remove any alternate DNS servers. Here's how:

Mac: mở cửa System Preferences, select Network, Advanced, & then click the DNS tab. Select any DNS servers listed, và then tap the - button to lớn remove them và apply your changes.

Windows: Right-click your network icon in the system tray & select open Internet & Network Settings, then click Network and Sharing Center. Click your connection name (typically Wi-Fi), select Properties, then click mạng internet Protocol Version 4 and select Properties again. There select Option an IP address automatically lớn use the mặc định DNS servers.

iOS: open Settings, tap Wi-Fi, and tap the i button beside your network name. Select Configure DNS & tap Automatic.

Android: open Settings, tap Advanced, then tap Private DNS. Choose Automatic.

With that done, turn off your Wi-Fi then turn it back on—and the login screen should open.

If not, you might need to lớn clear the DNS cache on your computer. Here's how:

Windows: mở cửa Command Prompt, and enter ipconfig /flushdns

Mac: xuất hiện Terminal, & enter sudo killall -HUP mDNSResponder

Now re-connect khổng lồ the Wi-Fi network, và it should work.

Still not connected? It's time khổng lồ try to lớn force your browser to mở cửa the login page.

Xem thêm: Thủ Thuật Visual Studio Code A, Mẹo Và Thủ Thuật Visual Studio Code Hiệu Quả Nhất

An easy trick is khổng lồ load the router's mặc định page. Try entering,,, or http://localhost in your browser address bar, và you might get the default login page to lớn load (or you might see a router settings login page—in which case, don't try to lớn log in unless you're at home).


If that doesn't work, mở cửa your network settings again, and chú ý your computer's IP address as in the screenshot above. Try entering that IP address in your browser, replacing the last number with 1. Or, kiểm tra the TCP/IP tab in your Network settings for the router's IP address if that doesn't work.

Or, if you're trying to lớn connect to a company's public Wi-Fi network—perhaps Gogo mạng internet on a flight or your cell carrier's Wi-Fi network in a mall—try opening that company's website. Most public Wi-Fi networks let you browse their company site without logging in, và they often have a links to their Wi-Fi login page. For instance, on a Delta flight, I opened & was able lớn view info about the trip and finally get the Wi-Fi login page to load.

3. Xuất hiện a non-HTTPS site in incognito


The problem could be that your browser cache is still trying to lớn use the DNS info it knows lớn access sites, instead of loading the Wi-Fi login page. And sometimes you can break it out of that loop by visiting something new.

You could clear your browser cache, but that's annoying, & you'd have lớn log back in to lớn everything. Instead, mở cửa an Incognito window in your browser, which loads with a clean slate. Then try visiting a non-HTTPS site; is a great option as it's non-secured and maintained by ICANN.

Another good option is lớn manually visit the site your device tries to xuất hiện in the background when connecting khổng lồ new Wi-Fi networks. You may have noticed your device loading when connecting khổng lồ Wi-Fi; you could go lớn that site directly lớn force your browser to kiểm tra the connection. Here are the mặc định pages, each of which works on any platform:

Tip: The reason you need lớn load a non-HTTPS site is that if you try khổng lồ visit a secure site and your network tries to lớn redirect your browser to lớn a login screen, your browser will prevent the redirect to lớn keep your data secure—something that will also keep you from logging in khổng lồ that Wi-Fi network.

On a Mac, there's another simple way to clear your network settings và likely get the login screen lớn load: a new network location. Network locations store your network settings for different locations, perhaps to make your computer use a different DNS at home than at the office or for an easy way khổng lồ change which networks you connect lớn by default.

Open your System Preferences & select Network again. Click the dropdown at the top, select Edit Locations, then click the + icon and địa chỉ a new location. Select it, & then try lớn connect lớn the network you want.

Just remember lớn switch back khổng lồ your default network location when you're back at your office or home.

5. Restart

Sometimes nothing works. In that case, vì chưng the one thing that typically fixes every electronic device: restart.

Turn off your Wi-Fi, then turn it back on.

Didn't work? Try logging out of your trương mục on your computer and then log back in—or just restart your computer.

That didn't work? Might be time lớn ask around & see if anyone else can use the internet. Perhaps that Wi-Fi connection is just down, or the router needs khổng lồ be restarted.

With any luck, you should be able khổng lồ get the Wi-Fi network screen khổng lồ load và can get back khổng lồ work—hopefully without trying everything in this list!

Stay secure on public networks

You've gone khổng lồ all that trouble to lớn get connected lớn a Wi-Fi network—but don't stop there. If you're on a public Wi-Fi network, you should also use a VPN khổng lồ encrypt your data and keep it secure from prying eyes. & you may need khổng lồ use a VPN lớn access your company's internal data and services.

For around $5-10 per month, you can get a VPN connection, typically with apps that make it easy to lớn use on your computer và mobile devices. Services lượt thích TunnelBear, NordVPN, ExpressVPN, and others make it easy to use a VPN—and TunnelBear even offers 500MB of không tính tiền data per month if you only work outside of your office or trang chủ occasionally. Or you could phối up a VPN server on your own hosting tài khoản or vps using OpenVPN or a similar tool.

Either way, remember to turn on your VPN on whenever you're on public Wi-Fi—as soon as you've gotten past the login screen, at least. Free Wi-Fi is not worth compromising your security.

Learn more about why to lớn use a VPN in our VPN guide. Then, another great way khổng lồ keep your data secure is with a password manager app, so you can easily use a unique, random password for each site. Here are the best password manager apps to try.

Odds are you'll need these tips when you're offline and can't connect khổng lồ the internet—which means you won't be able to re-open this page & refresh your memory about how to get your Wi-Fi lớn connect.

So, we made a miễn phí PDF cheat sheet for you. It includes all of this article's bộ vi xử lý core tips in a quick PDF that you can save & share with your friends and colleagues.

Make sure to lớn keep a copy of this How to connect to public Wi-Fi when you can't PDF saved on your computer & phone so you'll have these tips the next time you need them.

Download How to connect to lớn public Wi-Fi when you can't

Originally published January 16, 2017; updated September 21, 2017, November 13, 2018, and December 3, 2020, with a few extra tips.