LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Help with DNS (https://www.linuxquestions.org/questions/linux-networking-3/help-with-dns-277737/)

insurin 01-14-2005 11:02 AM

Help with DNS
 
I have just got a server with fedora and cpanel running. I went to namecheap.com and configured my domain (called domain1 for now) to point to ns1.domain1.com and ns2.domain1.com to my new servers ip address.
In my dns I have a few zones i.e. domain1.com, ns1.domain1.com, ns1.domain1.com, hostname.domain1.com.
Here everything is working splendid, the name servers have propagated and resolution is working.

I have another domain name that I also want working with this server. So I go to namecheap and tell this new domain (called it domain2 for now)
that the name servers are the same for domain1 (my original domain) so the name servers are the same for both of my domains that I own i.e. name servers for domain2 are ns1.domain1.com and ns2.domain1.com
Next in cpanel I created a new zone called "domain2.com" and that has setup all the usual i.e. www, ftp, cnames and A records. Once again this is working splendid.

Next I create a new account with the username dan and the domain "domain2" (which is the 2nd domain). I can access the account with the user name dan and password and I get all the control panel settings i.e. ftp, shoppoing cart, chat etc.

My problem is when I type http://domain2.com into the address bar I get the same web page that I get for my original domain (domain1) Which at first was the cpanel default "no web page configured" however I changed that to say welcome to domain1). To check this I opened up a ssh under the new account dan and see what is there which is, mail, public_ftp, public_html, tmp and www. I notice there is no index.html or similar in (www) or public_html, so I knock up a quick index.html just saying welcome to domain2.

I next go to my browser and type in http://domian2.com but still receive the web page for domain1.

Any help is much appreciated

Dan

cowanrl 01-15-2005 07:01 AM

You may not have the proper settings in your dns files. Execute these commands from your Linux box:

dig domain1.com

dig domain2.com

and see if they return the same results.

You can also direct the command to specific dns servers by including the IP address of the server. Sometimes it's interesting to query your own DNS server and other DNS servers on the Internet to see if your info has propogated yet. Try:

dig "ip address of your dns server" domain1.com

dig "ip address of your ISP's DNS server" domain1.com

and compare the results.

bathory 01-15-2005 08:13 AM

Since your dns is working fine, I suspect that you host both domains under the same webserver (virtual hosts). If that's the case check your virtual hosts settings.

insurin 01-15-2005 10:01 AM

yes you are right, I am hosting both sites from the same server. I have been allocated a block of 10 IP addresses.

Ill just post a bit more info.
In my http.conf at the bottom of the file I have a section like the following

<VirtualHost 205.209.144.x>
ServerAlias www.domain1.net domain1.net
ServerAdmin webmaster@domain1.net
DocumentRoot /home/network/public_html
BytesLog domlogs/domain1.net-bytes_log
ServerName www.domain1.net
User domainuser
Group domainuser
CustomLog domlogs/domain1.net combined
ScriptAlias /cgi-bin/ /home/domain1/public_html/cgi-bin/
</VirtualHost>


NameVirtualHost 205.209.144.x:80


<VirtualHost 205.209.144.x>
ServerAlias www.domain2.net domain2.net
ServerAdmin webmaster@domain2.net
DocumentRoot /home/domain2/public_html
BytesLog domlogs/domain2.net-bytes_log
ServerName www.domain2.net
User domain2
Group domain2
CustomLog domlogs/domain2.net combined
ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/
</VirtualHost>

Both virtualhosts are on the same ip address (if thats any help). No matter which url I enter into the address bar I get the same web page even though DocumentRoot is different for both and they have different index.html files.

I also don't know if this is any help but on my old server plesk had created some virtual interfaces i.e. when I did ifconfig I would have eth0 ip1, then eth0:1 ip2, then eth0:2 ip3. Now on this current server when I do an ifconfig I only have eth0 and lo.
I would say assume nothing as I am new to cpanel. If you would like to see my dns zone files just tell me.

thanks

bathory 01-17-2005 03:09 AM

Try to move the NameVirtualHost directive before the start of <VirtualHost ...> and see if that solve your problem.

insurin 01-17-2005 04:15 AM

its ok, I have managed to do it. I found another reference to that 65.75.178.x ip in my httpd.conf, so I changed this to my actual IP. I also then deleted domain1 and domain2 accounts as well as there dns zones. I then just re-created the accounts and the dns zones and everthing is working fine now.

Thanks very much for your help, it is much appreciated. No doubt in the near future I will need it again!

I am going to start looking at securing it now. I have seen a few links on this forum somewhere that shows you how to do it so I will go and have a look.


All times are GMT -5. The time now is 06:46 AM.