Web Hosting Forum | Lunarpages
News: October 6, 2008 - Submit Your Site for the October 2008 Site of the Month!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 12, 2008, 06:45:09 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Help understanding DNS  (Read 934 times)
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« on: September 01, 2007, 04:11:06 PM »

 Confused

I need some help understanding how I can use my VPS account to host multiple web sites. It all looks pretty simple to setu p using Plesk but I failed on my first attempt.

I have a customer who has an existing site hosted at another provider. I am moving them to my VPS. (My first web hosting sale  Clapping )

First I created a new Client via the Client pane in Plesk. That was easy.
Next I selected the client by clicking on the client name in the Client pane. This brought me to a pane where I can create a new domain for the client.

Now I don't understand how I can do this. I have only one IP address. How can I be using it and my client be using it at the same time. It says it is a shared IP address but I don't understand how this works.

I went to site where the customer got their domain name and changed the nameserver entry to point to my nameservers:
ns1.allcompso.com
ns2.allcompso.com

This is where I screwed up. I did this before uploading the site to the new domain I created above. (For some reason I can't ftp to that new domain but that is a different story). I was under the impression that a change like that would take 24 hours or more to take affect but it seems to have taken affect immediately. How come?

I panicked and set the servers back to what they were before. Now, it has been 5 or 6 hours and if I try to get to the customers site, I am presented the default Plesk page that says the site hasn't been uploaded yet. Why did it switch so quickly when I changed it to point to my nameservers but now it is taking forever to switch back? I don't understand that.

Now here is something else I don't understand. If I try to access my customers site from another network (one at work), I see the customer's site not the Plesk page. If I ping the domain, the IP Address is the one provided by the other hosting company. If I ping the domain from my pc, it shows my VPS IP address. This is too strange. Can anybody explain this to me?

I even went so far as to delete the domain and deactivate the client. I still get to the Plesk page if I try to access the customer's site from here. How is that possible?  Confused

In the new domain there is a DNS page. It contains something like the following where customerdomain is the customers domain name and allcompso.com is my VPS domain:
Host   Record type   Value
customerdomain.com.   NS   ns1.allcompso.com.
customerdomain.com.   NS   ns2.allcompso.com.
customerdomain.com.   A   74.50.2.129
customerdomain.com.   MX (10)   mail.customerdomain.com.
ftp.customerdomain.com.   CNAME   customerdomain.com.
mail.customerdomain.com.   A   74.50.2.129
ns.customerdomain.com.   A   74.50.2.129
webmail.customerdomain.com.   A   74.50.2.129
www.customerdomain.com.   CNAME   customerdomain.com.


This was all generated by Plesk. I assume I don't need to change anything here. Is that correct?

As you can see, I am totally lost. Can you help me understand how this all works?

Thanks,
George
Logged

perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1058



« Reply #1 on: September 01, 2007, 09:53:09 PM »

Hi George,

Let me try to explain how typical HTTP session opens and I hope you'll get answers to all your questions after that.

So when you type an URL in your favorite browser address bar, the following happens before the browser start reading answer from the web server:

1. Browser resolves the site name against the nameservers configured for your PC.

2. If the site IP is already cached on them, they just pass it to your browser.

3. Otherwise, the nameservers will try to resolve the IP address via nameservers listed under whois info for that domain.

This means that, if the site IP was recently changed and your nameservers have the old IP in the cache, you'll be still referred to the old IP until cache expires and nameservers refresh the IP info. If, there was no DNS info on the nameservers regarding the domain, they will try to resolve it as that was mentioned above and will get the new site IP from the site's nameservers.

Of course, not all nameservers over the Internet has the site IP address cached and thus some of them will resolve the site to the old IP and some to the new one during the propagation time when DNS change propagates other Internet when caches expire, which usually takes 24-72 hours.

DNS caching also explains why you were still referred to the Plesk placeholder page on your VPS even after you deleted the domain in Plesk.

4. Once the browser successfully resolved the site name to the IP, it connects to the web server to start HTTP session.

5. All modern browsers and web servers support HTTP/1.1 protocol that describes how to access multiple hosts using the same IP (this IP is usually referred as shared). This is done through the additional header Host that informs the web server which virtual host the browser wants to pass its request to. So, browser sends requests along with the Header value and waits for a reply from the web server on this step. HTTP session is considered as opened.

Please advise, if something is still unclear for you or if you have any additional questions.
Logged

Kind Regards,
Vlad Artamonov
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« Reply #2 on: September 02, 2007, 05:46:56 AM »

Quote
1. Browser resolves the site name against the nameservers configured for your PC.
I'm not sure my PC (the one I'm using right now to access the web via my Internet Provider) is a nameserver. I believe it does cache DNS entries though because I found that ipconfig /flushdns is suppose to flush my local cache. I did this but it didn't seem to have any affect. Anyways, I think I am dealing with two nameservers, one is at the other hosting company and one is in my VPS. Is that correct?

Quote
2. If the site IP is already cached on them, they just pass it to your browser.
So if the name is cached in my PC's local DNS cache, the browser doesn't have to go any further to resolve it. Is that correct? This was my understanding when I discovered ipconfig /flushdns. I thought sure that flushing it would take care of the problem but when it didn't, I wasn't sure what was going on.

Quote
3. Otherwise, the nameservers will try to resolve the IP address via nameservers listed under whois info for that domain.
This means that, if the site IP was recently changed and your nameservers have the old IP in the cache, you'll be still referred to the old IP until cache expires and nameservers refresh the IP info. If, there was no DNS info on the nameservers regarding the domain, they will try to resolve it as that was mentioned above and will get the new site IP from the site's nameservers.

Of course, not all nameservers over the Internet has the site IP address cached and thus some of them will resolve the site to the old IP and some to the new one during the propagation time when DNS change propagates other Internet when caches expire, which usually takes 24-72 hours.

DNS caching also explains why you were still referred to the Plesk placeholder page on your VPS even after you deleted the domain in Plesk.

So in my example, the nameservers you mention here are the ones at the other hosting company right? Might my ISP have nameservers as well? If I use dnsstuff.com to get a DNS report, it still shows the old IP address. So I think the new IP address that I temporarily set is stuck in my ISPs cache. Odd how that one took affect almost immediately but when I switched it back it is taking many hours (almost 24 so far) to propagate. It still isn't resolving correctly at the time of this writting but I agree that it is caching that is causing the affects I am seeing. It just isn't what I expected.

Quote
4. Once the browser successfully resolved the site name to the IP, it connects to the web server to start HTTP session.
Okay.

Quote
5. All modern browsers and web servers support HTTP/1.1 protocol that describes how to access multiple hosts using the same IP (this IP is usually referred as shared). This is done through the additional header Host that informs the web server which virtual host the browser wants to pass its request to. So, browser sends requests along with the Header value and waits for a reply from the web server on this step. HTTP session is considered as opened.
So there is something in the HTTP headers that tells my VPS how to route the request to the proper domain within my VPS. Correct?

Does it do this using the nameservers embedded in my VPS environment? Do I need to configure them or are the default values established when I create the domains sufficient?

Thanks for the help. I'm beginning to get a clearer picture of what is going on.

George
Logged

geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« Reply #3 on: September 03, 2007, 07:07:08 AM »

Here is another question that is somewhat related to DNS.

Where my customers web site is currently hosted somewhere else and I am going to move their site to my VPS site, how can I setup their site on my VPS before I change the nameservers to point to it?

How do I FTP to the domain I setup on my VPS? Obviously I can't use the customer's domain name to access the site because it is still pointing to their current hosting company.

Wow, I've got a lot to learn.  Help

Thanks,
George
Logged

geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« Reply #4 on: September 03, 2007, 07:43:26 AM »

Never mind, I figured it out.

I can FTP to the shared IP Address. I specified the FTP username and password I setup when I created the domain. When I connected using Filezilla, it somehow figured out (probably using the FTP username) where I needed to be and put me in the proper directory for the new domain. Amazing. Magic.

So now I can copy all the files from httpdocs folder on the customers exiting site to the httpdocs folder on the site I created. Then switch the nameservers and there shouldn't be any interruption in service.

Cool!  Applause

George
Logged

perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1058



« Reply #5 on: September 04, 2007, 09:52:57 PM »

Hi,

To reply to all your questions:

Quote
I'm not sure my PC (the one I'm using right now to access the web via my Internet Provider) is a nameserver. I believe it does cache DNS entries though because I found that ipconfig /flushdns is suppose to flush my local cache. I did this but it didn't seem to have any affect. Anyways, I think I am dealing with two nameservers, one is at the other hosting company and one is in my VPS. Is that correct?

Your PC queries only nameservers configured for it, usually those are your ISP nameservers.

Quote
So if the name is cached in my PC's local DNS cache, the browser doesn't have to go any further to resolve it. Is that correct? This was my understanding when I discovered ipconfig /flushdns. I thought sure that flushing it would take care of the problem but when it didn't, I wasn't sure what was going on.

Yes that's almost correct. Not the browser has to resolve the site, but nameservers which are being used by your computer.

Quote
So in my example, the nameservers you mention here are the ones at the other hosting company right? Might my ISP have nameservers as well? If I use dnsstuff.com to get a DNS report, it still shows the old IP address. So I think the new IP address that I temporarily set is stuck in my ISPs cache. Odd how that one took affect almost immediately but when I switched it back it is taking many hours (almost 24 so far) to propagate. It still isn't resolving correctly at the time of this writting but I agree that it is caching that is causing the affects I am seeing. It just isn't what I expected.

Usually, ISPs have their own nameservers to speed up DNS resolvings for their customers. So you are correct here.

Quote
So there is something in the HTTP headers that tells my VPS how to route the request to the proper domain within my VPS. Correct?

Exactly.

Quote
Does it do this using the nameservers embedded in my VPS environment? Do I need to configure them or are the default values established when I create the domains sufficient?

HTTP and DNS protocols are independent. DNS is used to resolve names to IP addresses and vice versa. HTTP is to transfer hyper text pages from server to client.

The zone created with the domain on setup usually is enough until you need very special configuration, for example, for cases when you host email somewhere else but not on the same server.

Quote
Where my customers web site is currently hosted somewhere else and I am going to move their site to my VPS site, how can I setup their site on my VPS before I change the nameservers to point to it?

To transfer a working site, you need to create a domain for it in Plesk and upload site content (as I can see from your last post, you have done the both steps already). Then you need to check that the site works fine at the new place. Plesk has amazing site preview option that works without DNS for domain testing. If all works fine, you change domain's nameservers and get the site working form your server in 24-72 hours after DNS propagation was completed.

I hope this helps.
Logged

Kind Regards,
Vlad Artamonov
geolev
Intergalactic Cowboy
*****
Offline Offline

Posts: 74


WWW
« Reply #6 on: September 05, 2007, 06:01:10 AM »

Thanks Vlad,

Your answers were very helpful. I transfered the site and it is live without any interuption in service. The customer is delighted. Clapping

Thanks again for the help,
George
Logged

perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1058



« Reply #7 on: September 05, 2007, 09:03:21 PM »


I'm glad to hear that. You are always  Welcome
Logged

Kind Regards,
Vlad Artamonov
Hamid_PaK
Newbie
*
Offline Offline

Posts: 3


« Reply #8 on: July 19, 2008, 01:09:31 AM »

hi.
we have a server (vps) with ns1.samaric.com dns but this address was on our another server.
so we set the domain dns now it will set to first server, but we want it set to the new server.
how we can change the new server dns to solve the problem ?

thnx, regards.
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1058



« Reply #9 on: July 19, 2008, 01:50:10 AM »

Hi Hamid_PaK,

If samaric.com will be hosted on your new vps, you need to register ns1.samaric.com at the domain's registrar first. Then you'll be able to set ns1.samaric.com as the domain nameserver. Instrudtions on how to do the nameserver registration with some popular domain registrars are available by the URL below:

http://www.lunarforums.com/lunarpages_dedicated_web_hosting/registering_private_nameservers-t27720.0.html
Logged

Kind Regards,
Vlad Artamonov
Hamid_PaK
Newbie
*
Offline Offline

Posts: 3


« Reply #10 on: July 19, 2008, 02:33:09 AM »

yup you right.
but i can't change the ns1.samaric.com ip and it set to the first server.

QUOTATION: In order to use your nameservers, you must register ns1.samaric.com with *.*.*.* (this is the new server ip) at your registrar.
when i want set the domain dns at ns1.samaric.com it get the first server ip but we want it get the new server ip!
i want to change the vps dns!

thanx for feedback.
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1058



« Reply #11 on: July 19, 2008, 09:42:33 PM »


Sorry, but why can't you change the IP for ns1.samaric.com?
Logged

Kind Regards,
Vlad Artamonov
Hamid_PaK
Newbie
*
Offline Offline

Posts: 3


« Reply #12 on: July 19, 2008, 10:54:54 PM »

so, we don't access to our registrar to change the ip Sad !!!

please help us.
Logged
perestrelka
Administrator
Master Jedi
*****
Offline Offline

Posts: 1058



« Reply #13 on: July 22, 2008, 10:01:03 PM »


If you are the owner of the domain, you should have the access, otherwise nothing will work to point the domain to the new server except doing that in the DNS zone in the current nameservers it is using.
Logged

Kind Regards,
Vlad Artamonov
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM