8

I know this question is basic but I am from iOS background and a beginner also. I need a clear conclusion on some of my confusion.

I have gotten many answers to this question having contradiction. I had searched on google about this question. Some says, to make your site available on internet, necessarily you will have to:

(1) Host your web site on hosting server providers like Amazon, GoDaddy, BigRock…

(2) Get a domain name for your web site. Whereas, some says, you can host website on your own server and make it available world wide. In that particular case, client will request through IP instead of domain name.

My question is, can I make a site and make it public world wide with following conditions:

  • Instead of hosting website on hosting service provider like Amazon, host it on my own server. No matter bandwidth, no matter performance, no matter uptime.
  • I don’t want domain name. No matter people access my site using my public ip e.g. 123.456.789.0 - just adding this condition due to curiosity..

Thanks in advance !!!

12

You can host a website on a home system, if you like. There is a caveat, though. Some Internet Service Providers (ISPs) don't allow their customers to host their own servers, while others will allow you to do so. An ISP that doesn't allow home users to host their own servers may block traffic on the ports commonly used by servers. E.g., it can stop someone from running his own mail server by blocking connections from the Internet to port 25 on the IP addresses it assigns to home users. Likewise it could stop someone from hosting her own web server by blocking the default port used for HTTP, port 80, and the default port used for HTTPS, port 443. Someone might be able to circumvent such a block by running a web server on a nonstandard port. E.g., if the web server was configured to listen for HTTP connections on port 7080, if you could provide that port number to everyone who might visit your site, they could still get access to the server. E.g., instead of using http://www.example.com/sompage.html or http://10.0.0.5/somepage.html, visitors to the web site could use http://www.example.com:7080/somepage.html or http://10.0.0.5/sompage.html. Though even that traffic could be blocked by an ISP.

That solution might work, if you expect your website to be visited by just a few friends, but might be more problematical if you hope to have a worldwide Internet audience for your site, since most people are not accustomed to including a port number when visiting a site. Though, if you are linking to your site from other sites, as long as the port number is included the link would work.

But, supposing the ISP doesn't prevent you from hosting your own web server. You will need to configure your router to forward traffic destined for the default HTTP port, and possibly HTTPS, if you will be using that protocol as well, to the internal private IP address of the web server on your Local Area Network (LAN). This is necessary because most home users have a router performing Network Address Translation for communications between systems behind the router on the LAN side and systems on the "outside", Internet-facing side, of the router, i.e., the Wide Area Network (WAN). I.e., they have one external public IP address for the router, but there may be multiple private IP addresses for systems behind the router. E.g., you might have a laptop with an address of 192.168.0.4 and a desktop system with an IP address of 192.168.0.5 behind the router. Those private IP addresses are not routed over the Internet. A home router will typically perform NAT to allow external systems that see only the one public IP address to communicate with systems behind a router with private IP addresses.

Most home routers provide the capability to perform network address and port address translation and it is usually fairly easy to set up, you just need to know that you have to do that. Some routers may have a demilitarized zone (DMZ) setting that allows you to specify that any connections that originate from outside the router go to a particular system on the inside of the router. If you want your home server to be accessible via NAT/PAT, you will likely need to assign it a static IP address rather than one that may change because it is assigned via the Dynamic Host Configuration Protocol (DHCP), so the router can always route incoming connections to the right system.

In addition to the IP address of systems on the internal side of your router possibly changing, if you are using a home network connection, your ISP likely assigns the external IP address of the router via DHCP as well. Let's say it is xxx.xxx.10.250. Tomorrow it may be xxx.xxx.10.251. It depends upon the "lease time" the ISP uses for assigning IP addresses via DHCP to its customers. The lease time could be a few hours, a few days, a month, etc. So, if you tell people your web server is accessible at xxx.xxx.10.250, whenever it changes you will need to tell them the new address. Though, for some systems, even though your ISP may not provide you with a static IP address, but instead provide a dynamic one, it may stay the same as long as you don't replace the router. E.g., for my home Internet service, I don't have a static IP address, but the only time it has ever changed over the course of many years is when I replaced the router, so the ISP's equipment then saw a different Media Access Control address from a new router.

Even if your IP address changes frequently, you may be able to purchase a static IP address from the ISP. Some will sell a static IP address to home users for a monthly fee, while many will not.

But a solution I use when I need to be able to connect to a home user's system externally for troubleshooting or to set up a home-based server is to use Dynamic Domain Name System. That allows you to access a home-based server using a fully qualified domain name (FQDN), e.g. martijn.example.com, even if the external IP address of the router varies. I use No-IP.com, but there are other DDNS services, as well. The way DDNS works is that you install software on a system on the internal , LAN side, of the router that periodically communicates with a DDNS service-provider system, so that the DDNS provider knows the current external IP address from which the system is communicating. The DDNS provider then updates its Domain Name System (DNS) servers, which are the servers that translate FQDNs, such as martijn.example.com, to IP addresses, to reflect the current external IP address for your router. So anyone putting martijn.example.com in her browser will be directed to the correct IP address. Some routers have a configuration option that allows you to specify a DDNS service-provider, so you may not even need to install any software on a home system for it to work; you would just need to have an account with a DDNS provider.

DDNS providers will charge you a fee to use your own domain name, e.g. martijn.com, if you wished to purchase your own domain name. But you may even be able to use a DDNS service for free, e.g., No-IP provides a free service, if you are willing to use a domain name provided by the DDNS provider. E.g., if the provider owns example.com, you may be able to use martijn.example.com for free, though you would have to pay for martijn.com. I.e., you can specify a particular host name, e.g., martijn, to use with one of their domain names.

I've used such a configuration for a home-based website for many years. If you have a fairly reliable Internet connection and your ISP doesn't block access to home-based servers, it can actually work fairly well for low traffic sites. E.g., if you don't expect to have more than a few hundred visitors to your site every day and aren't already saturating your available bandwidth. But there are considerations you need to know about, i.e., the ones I mentioned above, when setting up a home-based server which may lead some to recommend using a hosting service.

Though such a configuration can even be used for a small or home-based business, I would not recommend it for a small or home-based business if access to your website is critical, if your external IP address can change frequently, since when someone visits your site their system will cache your IP address so that the next time they visit the site the system doesn't have to look up the IP address that goes with the name again. There is a time to live (TTL) value for such cached DNS entries, so they will expire and the system will look up the IP address again, but they may stay on a system for many minutes or even hours. And other DNS servers also cache entries, also. E.g., suppose Mary is a Comcast customer whose system connects to martijn.example.com. Her system may query the Comcast DNS servers to get the IP address for the website. So now the Comcast servers know the IP address that goes with the FQDN. Another Comcast customer, Bill, also wants to visit your site. He has never visited your site before, so his system hasn't cached the translation between martijn.example.com and its IP address, but when his system queries a Comcast DNS server, if that server already knows the address that is associated with the FQDN, it will provide the answer from its cache.

So, if your IP address changes, even though your server or your router may within a minute update the DDNS provider's DNS servers, others may still get the old IP address and so your website is inaccessible to them until their system or their ISP's DNS servers gets the new, current IP address. Due to caching and depending on the TTL setting, it is possible some systems might still try to connect to the old IP address many hours later or maybe even the next day. That may not be a serious problem if you just want to make your website accessible to family and friends, but if you are running a business, that is likely an unacceptable problem.

Update to address comment:

when you purchase a domain name from a domain name registrar, you often have the option to specify an IP address or addresses for systems that should be accessible via the domain name at those addresses or you can temporarily "park" the name, so it points to systems belonging to the registrar. When you are ready to specify your own IP address, registrars typically offer DNS services that allow you to modify the IP addresses associated with domain names whenever you like. Many also allow you, through their DNS service to adjust the TTL value, i.e., the amount of time that a system should cache the IP address that goes with a FQDN. So, if you thought you might need to change the IP address frequently, you would specify a shorter TTL. The registrar might have a minimum TTL you can specify, e.g., 5 minutes or 30 minutes. The value is usually specified in seconds, so a TTL of 5 minutes would appear as 300.

So, if you are using the registrar's DNS service, you will need to log into your account with the registrar and change the IP address or addresses associated with your domain name manually each time there is a a change. Or, alternatively, you could use a DDNS service provider so that the change in translation from FQDN to IP address happens automatically. You could either purchase the domain name through the DDNS service provider and so use their DNS servers by default or purchase the domain name from another registrar and specify the IP addresses for the DDNS provider's name servers through the configuration page for your website provided by the domain name registrar

Another option would be to run your own DNS server. When your purchase a domain name, you can specify the name servers that should be used with it, either the registrar's name servers or some other name servers. E.g., you could have the same system that is a web server be a DNS server. You would have to ensure that server would be accessible on port 53, which is the default port for DNS, for the UDP and TCP IP protocols. You could then create a script/program on your server that periodically checks to see what external IP address is assigned to your router and update the zone file for your domain name on your DNS server. Setting up a DNS server is a lot more complicated than relying on a DDNS provider, though. You can find tutorials for setting up a DNS server online, if you wished to pursue that more complicated route. BIND is commonly used for DNS service on Linux systems. Microsoft's server versions of Windows, e.g., Windows Server 2012 have a Microsoft-provided DNS service that can be used, as well. I'd suggest starting with a registrar's DNS service, which is typically free when you've purchased a domain name from the registrar, though, even if you thought you might want to embark on that more difficult path of running your own DNS server. Unless someone wants to learn how the underpinnings of the Internet, such as DNS servers work, sticking with a registrar or DDNS service provider's DNS servers is likely the best course for most people. You can also get DNS service through companies that specialize in DNS services, such as OpenDNS.

Keep in mind, though, that even if you specify a short TTL value and have automatic updates, there is a possibility for a greater delay than the TTL between the time you get a new IP address and the time all systems on the Internet stop using the old IP address and use the new one. E.g., see the GoDaddy article, What Factors Affect DNS Propagation Time? (GoDaddy is a domain name registrar), which explains why it could possibly take up to 48 hours before the new address is available to all systems on the Internet. E.g., the article states "Some ISPs ignore TTL settings and only update their cached records every two to three days."

  • 1
    Really tremendous and comprehensive explanation @moonpoint. Thanks a lot - Upvoted. I have one question regarding taking a domain name. Getting domain name means assigning IP numbers to NAME. Now again, same question is arises..IP numbers including public IP changes periodically. What is the secret behind that, I mean how it is managed after we get a domain name for our website ? – NSPratik Jan 26 '16 at 9:50
  • 1
    @NSPratik, I added some additional information at the end of my prior post to address your question. – moonpoint Jan 26 '16 at 16:49
  • Thanks @moonpoint, let me study your edit and will get back to you. I think you are not from this planet :D – NSPratik Jan 26 '16 at 17:12
  • 5
    I've been using a custom domain name with Noip for free for a long time now. All you need to do is CNAME your custom domain to the Noip domain that they give you. – Maximillian Laumeister Jan 26 '16 at 18:17
  • Nice answer. You may also want to add the necessity to keep the systems up to date and free from vulnerabilities. That, in of itself, is the scariest part of hosting a system at home - being hacked. Cheers!! – closetnoc Jun 13 '16 at 3:18
4

You can start out hosting it on your own computer. I started out hosting my first website on my own computer. Now I make my living from websites. But when you do so, be aware:

  • Your home is going to have lousy uptime. Your site is going to go offline for a variety of reasons: snow storms, traffic accidents, neighbors hogging bandwidth, your microwave tripping the circuit, or your ISP blocking a port.
  • The bandwidth to your house is lousy. Very few residential ISPs offer decent upload speeds (which is what you need to run a server). Even if your local ISP is good, the bandwidth your get is not ever going to be enough to run a large website.

Most websites are hosted at data centers. These data centers have backup power, they are located near internet backbones, you can get extra bandwidth much more cheaply than bandwidth to your home.

You can certainly start by hosting your website at home, but when it becomes big enough, be prepared to move it. Your first hosting plan should cost $50 to $100 per year. You are likely paying that per month of home internet service, so the overhead is very minimal. Start out with "shared hosting" where you get an account on a computer hosting many websites.

Using an IP address for a website is also not ideal. Most residential ISPs use DHCP to automatically assign the address. The address can (and will) change occasionally. You can use "dynamic DNS" to get around this. Some dynamic DNS providers will give you a subdomain for free (mysite.example.com). Your computer will ping the dynamic DNS server and change the IP address for your site when the IP address changes.

You should consider buying your own domain name even before you get your first hosting. You can often use your own host name with dynamic DNS services. A domain name costs in the neighborhood of $10 per year.

  • 2
    I host my own server with excellent up-time and as much as 80meg upload and download it I want. You do not need a lot of bandwidth. Most of the time, a standard DSL with just 10meg download will provide enough upload bandwidth for even a fairly busy site and decent up-time. I used to be a web host with servers in a NOC (network operations center) but used my at-home DSL (commercial at the time) for robot operations and external monitoring. It all worked just fine with 100% up-time for over a decade. Of course it helped that I was the network engineer that set it up. ;-) DSL can be fine. – closetnoc Jan 25 '16 at 16:35
  • 1
    You must not live where I do. My power company only has like 95% uptime and my ISP is only a little better. – Stephen Ostermiller Jan 25 '16 at 16:37
  • 1
    My Sprint then Embarq DSL (non-commercial) ran for 8 years only 20 minutes of downtime total in the 8 years. I have Centurylink now and only experience as much as 30 minutes of downtime a few times (3 or 4) a year for scheduled maintenance. Otherwise, the connectivity has been fairly decent and I have no complaints. This will not always be the case of course. It depends upon your carrier and where you live. I live in the mountains. Can't beat the up-time considering. – closetnoc Jan 25 '16 at 16:41
  • 1
    And yes - there are lousy carriers that suck. But there is no such thing as a monopoly anymore where DSL is available. You can always call someone else. All you need is a line and a Redback on an UPS which should be everywhere (in theory). Cheers!! – closetnoc Jan 25 '16 at 16:44
  • @closetnoc be thankful you aren't on the edge of a regional Australian city. Despite the place trying to promote itself as a technology hub I can't even get ADSL2+ :( – Steve Jan 26 '16 at 20:39
4

Yes you can host it on your own server. If you have a static IP, just set up your network as if are a server and this should work. There is plenty to be found on the matter.

You don't need a domainname. A domainname is for the common user, it's a whole lot easier to remember a name than an IP address. Just think of your contact list, it's easier to remember the names than the actual phone numbers.
The simpelest way to see a domainname is as an alias. For the bigger servers which have multiple sites on an IP address it's also used to differentiate between the sites (eg siteA and B point both to the same IP, the corresponding server has to be set up to show site A or B, depending on the request).

As example: 64.15.117.85 (No worries, it's just Google. Or is it?)

I don't recommend using your own server tho. There are plenty of cheap servers/hosters. You might save a bit of money (but I doubt it), but the of ease setting up a new domain there outweights that IMO. Most hosters are almost plug-and-play, while setting up your own server, proper firewalls, antivirus, maintaining updates is going to take a lot of time and maintenance.

  • Wow, it's great !! So domain name is all about attaching name to the number same way we did in our mobile phonebook, is it ? – NSPratik Jan 25 '16 at 11:04
  • And you are not saying that "Domain name is not required at all".. – NSPratik Jan 25 '16 at 11:04
  • 2
    The phonebook analogy is correct. A domain name is easier, but not required :) – Martijn Jan 25 '16 at 11:17
  • Hosting on your own server actually costs more than a cheap hoster, there is no saving so that is not a valid reason to do it at all. – JamesRyan Jan 25 '16 at 16:29
  • @JamesRyan are you talking about the electricity costs of leaving your computer on all the time? – Stephen Ostermiller Jan 25 '16 at 16:57
3

My question is, can I make a site and make it public world wide with following conditions:

Instead of hosting website on hosting service provider like Amazon, host it on my own server. No matter bandwidth, no matter performance, no matter uptime.

Yes.

I don’t want domain name. No matter people access my site using my public ip e.g. 123.456.789.0

You do not need a domain name to host a publicly available web site.

While other answers go into much more detail, the simplest configuration is to download a web server such as Apache for Windows and set it up on the computer you would like to use to host your site. I would suggest the 32-bit version for maximum compatibility.

Unzip and copy the files to C:\Apache24.

There is also configuration file you need to edit called "http.conf" located in your Apache installation directory under the "conf" folder. Uncomment the line marked "ServerName" (remove the #) and save the changes. Note you may want or need to make other changes later but this should do for now.

Assuming you placed your installation in C:\Apache24 as recommended for the referenced version of Apache on Windows, you technically now have a running web server and can start it by double clicking "httpd.exe" in the Apache "bin" directory. You should be able to see "It Works!" if you type in the local network IP of the server into your browser ex. 192.0.0.100.

If you have Linux, you likely already have Apache installed and need to take different steps.

Once Apache is verified to be running correctly, use port fowarding on your router (assuming you have one) to direct port 80 requests to the computer running Apache.

If all goes well, this is all you need and Apache should be available from the "internet" via your public IP address ex. 68.69.70.250.

Note that firewalls and antivirus software can sometimes interfere with seeing your site outside your local network. Also, it is best to test via a device not on your local network (e.g. try accessing your site on your phone browser). Long story short, some routers have an issue accessing a site at ex. 68.69.70.250 if that site is on your local network (see "NAT Hairpinning").

  • Does public ip stays same forever ? Because previous answer of this question raises that point that your IP may vary in future and you will have to update as per change.. – NSPratik Jan 27 '16 at 10:38
  • No it is possible for your ISP to change your public IP. This is why people prefer domain names. – Anaksunaman Jan 27 '16 at 10:41
  • You may want to read this answer I gave elsewhere -- superuser.com/questions/778640/… – Anaksunaman Jan 27 '16 at 10:44
1

I would recommend going with free blogging platforms such as wordpress and blogger. You dont have to worry about hosting nor domain. Also you will find tons of free themes to get your website up and running.

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.