I have installed lighttpd server on my raspberry pi to use it on local network. I want to access that webpage globally with a domain. My friend has its own external linux based web server. Can I use that server and a domain to connect to my raspberry pi server? or just connect my pi server directly to a domain. If yes, how can I do that. I dont want port forwarding as my pi server is remote and can be connected to mobile networks (3G/4G) or LAN. Thanks
Yes you can. What you need is dynamic DNS.
It is unlikely that your domain registrar provides an API to update A records. So I would suggest looking for somebody else that does. I use entrydns.org. For a one time fee (I think $10), you can set up quite a few domains (dynamic hosts). Create one of any name, say hamza.entrydns.org and look for the authetication token. To update the IP address of hamza.entrydns.org to, say, 184.108.40.206, it is a one-line Http GET command to the following url:
Next go to your domain registrar and create a CNAME record for your domain. Enter
hamza.entrydns.org as the CNAME value for your domain (@). Now anyone who tries to look up your domain will be looking up hamza.entrydns.org instead.
Now create a script on your Pi, or any other computer on the same LAN to do the following:
(Say the domain you own and are using to reach your Pi is
- Hit http://sameoldplace.net/rsv.asp or one of many other "find my IP web pages" (using curl or wget) and parse the output to look for your Pi's Internet IP address.
- ping hamza.entrydns.org (or hamza.com) and parse the IP address from the output.
- Compare the result of step 2 with step 1. If it is the same, return, else hit
https://entrydns.net/records/modify/**authentication token**?ip=<new IP address obtained from step 1>
Schedule the script to run on your Pi, say, every 30 minutes.
Hope this helps.
No, you cannot. To be able to access your pi, anyone from the Internet must be able to contact your pi. And that requires some form of port forwarding. Sam if your friend would be willing to proxy for you: your friend still needs to connect to your server, which, again, in general means port forwarding.
Note that it should be worthwhile to get some basic network knowledge before attempting anything in this field. You seem to confuse a DNS domain name with Windows domains; they are not the same
Anyhow you have to connect your Pi to Internet. In other word we can say yo have to do Port Forwarding on your Router or else your friend's router, if he wants to proxy for you.
you can make Free account in free DNS(that i provide two references above), and configure hostname as per your requirement. now you can active new DNS service in your Router with DNS provider, Username, Password and your hostname and Port Forwarding(in your case port 80, HTTP Service).
That's it. Now you can access your webpage from anywhere with just type of your hostname in browser. Enjoy :)