LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-14-2005, 11:02 AM   #1
insurin
Member
 
Registered: Nov 2004
Posts: 32

Rep: Reputation: 15
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

Last edited by insurin; 01-14-2005 at 11:04 AM.
 
Old 01-15-2005, 07:01 AM   #2
cowanrl
Member
 
Registered: Dec 2004
Location: Western Pennsylvania, USA
Distribution: Red Hat
Posts: 150

Rep: Reputation: 15
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.
 
Old 01-15-2005, 08:13 AM   #3
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
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.
 
Old 01-15-2005, 10:01 AM   #4
insurin
Member
 
Registered: Nov 2004
Posts: 32

Original Poster
Rep: Reputation: 15
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
 
Old 01-17-2005, 03:09 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Try to move the NameVirtualHost directive before the start of <VirtualHost ...> and see if that solve your problem.
 
Old 01-17-2005, 04:15 AM   #6
insurin
Member
 
Registered: Nov 2004
Posts: 32

Original Poster
Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dns client cannot resolve on dns server jtvillegas Linux - Software 3 03-12-2016 03:30 PM
Do I leave primary and seconday DNS blank for a DNS Server? imsam Linux - Networking 3 10-25-2004 01:48 PM
lame dns servers etc and general dns issues suse_linux9.1 Linux - Networking 3 06-01-2004 01:50 PM
DNS still slow after installing caching DNS mooreted Linux - Networking 16 01-01-2004 12:18 AM
need help to set up caching only dns server to with bogus DNS entries ullas Linux - Networking 1 10-28-2003 01:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration