2

The way I know commercial hosting on shared servers is like the following:

    1)ns records with web host 
    2)I have to configure the domain with my registrar to 
have the ns records hosted by web host

But how will it work if I wanted the ns records to hosted by my registrar for redundency. How does the web server know which site to serve ?

user20338
  • 271
  • 1
  • 5
  • 11

1 Answers1

3

Is it possible? Yes, certainly. Web hosting and DNS services are two completely separate functions. Yes, they can coexist on the same server, but they don't need to.

Just point your domain's NS records to whomever you want and then create an A record pointing to your webserver. When your browser makes a request to the webserver, it submits as part of the HTTP GET request a host header with the hostname of the website it's requesting. The server then responds appropriately. In fact, this would all still happen even if the webserver was not set up with proper DNS resolvers.

EEAA
  • 109,363
  • 18
  • 175
  • 245