Trying to make an app that would work for clubs that meet in locations without internet or wifi (ie church basements).

I found this question and answer, but found no hope https://stackoverflow.com/questions/10502645/serving-a-local-website-via-bluetooth-to-a-cellphone-without-using-the-internet since the top answer was super high level from 2011.

I then found this from 2014 https://discussions.apple.com/thread/4308091

This part worked:

You need to make it work, by assigning blutooth PAN a manually assigned ip address. subnet and in router address field, provide DNS as and second dns Of course enable the internet sharing beforehand.

My Mac was serving on localhost:9190 and I was able to go to http://macname.local:9190 to hit my website where macname is what showed up in my "Sharing" system settings when doing Internet Sharing from Bluetooth PAN to computers using Bluetooth PAN.

I celebrated this working, but I have no idea what the DNS bit is for, given I never type those numbers. What am I doing manually that makes this work? Ensuring that the ip and router are the same address? I tested this with zero internet (wifi off) on my laptop. Really just looking to understand why/how this works


You say that you want to serve a website without the internet but then you start talking about DNS and show a public DNS server. This shouldn't be relevant. The numbers you see there are likely the default for your device.

A BT PAN is a "Personal Area Network" using the BT interface just like any other network interface. Bluetooth is a wireless network protocol. BT is a peer-to-peer connection so you are only talking to one other device at a time. The BT connection is on layer 2. You need to configure TCP\IP (Layer 3) on top of that connection. Then you can host HTTP (Layer 7).

In your scenario, phones connecting to phones using your app, there is no DHCP server and no DNS server. This means that the IP address on both ends needs to be statically defined, different, and in the same subnet. This may be more difficult than it sounds to dynamically configure from your app. It would be simplest to communicate directly via IPs but if you want to use a hostname you don't have to rely on DNS: you could use Bonjour or NETBIOS.

  • So I have a little nodejs express app running on my machine. With the bluetooth internet sharing, my machine becomes available so a phone can hit that http address even if my machine is not connected to any specific router. I honestly have no clue about the DNS bits which seem superfluous, but probably aren't. When I ran this test, I disabled my wifi on laptop and running ifconfig provided zero IPv4 addresses. I had to use the .local address. Wondering if using a router as a way to share network on local IP would make more sense. Never thought of using router w/o it having net – Dave Stein Feb 23 at 18:07
  • Secondarily, if I were to just have a wifi router that everyone connected to, such that they can hit my machine's IPv4 address, wouldn't that simultaneously make their phones lose the internet connection as the phones try to get internet from a device with no internet? :) – Dave Stein Feb 23 at 18:09
  • Like I said, the DNS server is irrelevant. That IP is owned by Google and if you aren't on the internet you aren't using that server. Your hostname resolution is likely being performed by Bonjour because you are using iOS devices. You don't need a router if you are using Bonjour. The only reason you would use a router is to connect more than one user at a time. They would lose internet unless their device is using the cellular connection. – HackSlash Feb 25 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.