Get Ubuntu To Connect To Starbucks WiFi (Captive Portal)
To start you need another device to get the Starbucks Captive Portal DNS IPs.
For example with my iPhone I go to Settings > “i” in the circle on the right of “Starbucks WiFi” > Configure DNS
Step by step… with little images :~)
Go to Settings
Make sure your WiFi is connected to “Starbucks WiFi”
Click on the blue circle with the “i” in it
Scroll down you should see the DNS option
Then you should be able to see the two DNS IPs
Now that you have the two DNS IPs, you will now go to the network settings on your Linux (Ubuntu) system. They are many ways to access the network settings. You can easily find those ways online.
Since I use i3wm I will show you how I access it.
- In the terminal, I use this command: nm-connection-editor (it might not exist on your Linux distro)
- It will show a GUI with your Network Connections
- You should see the “Starbucks WiFi”; double click on it
- Then go to the tab: IPv4 Settings
- You should see an input for “DNS servers”
- In that input, add the two DNS IPs (separate the IPs by using a comma “,”)
- Make sure to save
- Now you want to clear the DNS cache and restart your network service
Since the way to clear DNS cache might vary between Linux distros, you might need to search online on how to do it on your system.
Here are some of the commands I use:
- sudo /etc/init.d/networking restart
- sudo /etc/init.d/dns-clean restart
- sudo /etc/init.d/networking force-reload
- sudo /etc/init.d/nscd restart
- sudo /etc/init.d/dnsmasq restart
You can always restart your network service on your system:
- sudo service network-manager restart
- sudo /etc/init.d/neworking restart
If it still fails.
Try mapping the IP of Starbucks to the domain that Starbucks uses for their Captive Portal. Where I am located the domain is: secure.datavalet.io
To get the IP to map to secure.datavalet.io use this command (make sure you are connected to the “Starbucks WiFi”, first ;) ): ip route
The first line of the result of the command “ip route” should give you an IP that is used by the WiFi router.
Then in your /etc/hosts file add this line:
10.0.9.1 secure.datavalet.io
Again, those values might be different for you.
Here are some links that might be useful, if you keep having issues connecting:
- https://askubuntu.com/questions/1023429/cant-connect-to-google-starbucks-wifi-on-ubuntu-17-10
- https://askubuntu.com/questions/849428/cannot-connect-ubuntu-to-starbucks-wifi-network
- https://askubuntu.com/questions/1016868/unable-to-access-the-internet-at-starbucks-used-to-work-with-ubuntu-16-04
- https://askubuntu.com/questions/1005628/cant-connect-to-starbucks-wifi
- https://askubuntu.com/questions/1005628/cant-connect-to-starbucks-wifi/1020934
Hopefully this helps!
In the future I might write up a shell script to automate this… Maybe even an Docker container that will handler all of this :-0.
WARNING! By using StarBucks DNS they will be able to track your internet activity. You might want to look into getting a VPN. ;)