Getting .local domain working on OS X and iOS
I have been playing around with the Raspberry Pi recently and came across a problem, it happened when I put a web server on it and wanted to view it on my local network.
"So what's this to do with OS X and iOS?" you say, well when I tried viewing the website via it's local name which is 'raspberrypi.local' on my Mac and iPad it was timing out, but I could get to it via the ip address which was a little confusing.
After days of scratching my head over this and trying very ideas of the internet it occurred to me it might me a firewall problem. So I had set up iptables on the Pi I removed them for experimental purposes and tried again and bam! It worked.
So what was the problem? It has to do with the way OS X and iOS look for .local domains, they use bonjour to find .local domain and my firewall was blocking it. So the fix is to allow bonjour through the firewall.
Bonjour run on port 5353 using the UDP protocol so all I had to is add the firewall rule for my network which is running on the 192.168.1.* range the rule I added was this
-A INPUT -p udp --dport 5353 -s 192.168.1.0/24 -j ACCEPT
With that added to the firewall I was able to once again use the .local domain on my Apple devices.
I hope this helps someone