LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-22-2018, 04:31 PM   #1
dcole1990
LQ Newbie
 
Registered: May 2018
Posts: 5

Rep: Reputation: Disabled
Having troubles setting up my shared hosting on my VPS


Hello people!

I do hope I am in right place for this question.

At this moment I am quite confused so I will try to provide as much information as I can and will try to explain what I want to do in depth.

So I have shared hosting and registered domain on one IP with one nameservers. I want

whole hosting to point to IP of the VPS, I've created private nameservers and pointed

domain to them, but I do not know how to properly set up my DNS server on VPS itself.

Currently domain is not resolving (ofc), shared hosting is still showing IP of it's

own ( together with nameservers ). My hosting provider told me that I created private

nameservers properly and that I now only have to setup DNS server properly so that it

uses my private namservers. They also told me that it's possible to transfer content

from shared hosting to my VPS, but that it's something I have to do by myself. I am

99% sure that issue is somewhere in named.conf and /var/named but I am not sure where.

I've tried and followed almost every guide that could be relevant without any luck, so

I was hoping someone here could assist me, I have basic understand of the linux so

this shouldn't take too long if I am guided in right direction.

Please let me know what logs or files would you like to see and I'll provide them.

OS CentOS Linux release 7.5.1804 (Core)


Thanks in advance!
 
Old 05-23-2018, 03:20 PM   #2
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hi dcole1990,

Welcome!

I think there is some misunderstanding of DNS afoot. What is your purpose for maintaining your own name server?
 
Old 05-24-2018, 07:30 AM   #3
dcole1990
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hey AwesomeMachine and thank you very much

Well to be honest, I was thinking yesterday about this and I am thinking that it would be simply easier for me to revert back do default nameservers. Why I wanted domain to point domain to private nameservers was simply because I wanted it to point to my personal VPS, but I am guessing that It can be done without creating private nameservers?

If whole hosting is transferred to VPS i guess there is no need to point to private nameservers or am I now getting everything completely wrong?
 
Old 05-25-2018, 04:33 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
The thing is, no one will use your private name server besides you. If you have a registered domain, it's already in the root servers.

edit, I stand corrected below.

Last edited by AwesomeMachine; 05-25-2018 at 05:00 PM.
 
Old 05-25-2018, 04:47 PM   #5
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,376

Rep: Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551
I'm going to respectfully disagree a bit here.
If a domain's authoritative domain name servers are a privately hosted DNS server, then the world will use them.

Having done that in the past, I ran into a couple of problems:
  • The RFCs require at least two, and preferably three, domain servers for a domain, and they are to be in different subnets.
    That's tricky to set up. I did it by having two IP addresses pointing to the same bind setup, but was still in violation of the "separate subnets" part. [Not that there's anyone out there actually policing...]
  • The name servers were on the same hardware as the web server, so if the server failed (or more usually, got disconnected when the phone line went down), nothing worked. The domain name couldn't be resolved (but if course, even if it could, the mail/web was still off-line,so...)
I've since abandoned the attempt to maintain my own name server. I use the registrar's name servers to point my domain names to my IP(s) [I use different IP addresses for web and email]
That has freed me up from maintaining a bind installation at all.

Note that in either case, my domain hosting was on my own server (which could be your VPS?) instead of a "shared server"

PS I note that we've caused this thread to drift away from the OPs request for help with his bind/named setup.
OP: If you still want to try that [if we haven't persuaded you not to ], please follow-up accordingly, and I'm sure someone will help. You'll probably need to post (in code tags) the contents of your named.conf

Last edited by scasey; 05-25-2018 at 05:07 PM.
 
Old 05-26-2018, 03:05 PM   #6
dcole1990
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Ok, so let's say that I change nameservers to default ones. What should I do and configure so that shared hosting is pointing to IP of my VPS and that whole hosting in general is transferred to VPS? Can cPanel account from shared hosting even be transferred to VPS?

I will copy my named.conf configuration below, but do mind that I've changed it so many times trying to make this work that you will probably see many lines that aren't suposed to be there .


Code:
include "/etc/rndc.key";

controls {
        inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
};

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
    listen-on port 53 { 127.0.0.1; 185.62.75.120;}; ### Master DNS IP ###
#    listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
    statistics-file "/var/named/data/named_stats.txt";
    memstatistics-file "/var/named/data/named_mem_stats.txt";
    allow-query     { localhost; 185.62.75.120/24;}; ### IP Range ###
    #allow-transfer{ localhost; 185.62.75.120; };   ### Slave DNS IP ###

    /*
    */
    recursion no;

    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";

    managed-keys-directory "/var/named/dynamic";

    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";
};

logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
    type hint;
    file "named.ca";
};

zone "memes4you.com" IN {
type master;
file "forward.memes4you";
allow-update { none; };
};
zone "75.62.185.in-addr.arpa" IN {
type master;
file "reverse.memes4you";
allow-update { none; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

Last edited by dcole1990; 05-26-2018 at 03:07 PM.
 
Old 05-27-2018, 12:19 AM   #7
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,376

Rep: Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551
Quote:
Originally Posted by dcole1990 View Post
Ok, so let's say that I change nameservers to default ones. What should I do and configure so that shared hosting is pointing to IP of my VPS and that whole hosting in general is transferred to VPS?
To be clear, by "default name servers," do you mean the name servers operated by your domain registrar? There are no "default" name servers as such:
  • A domain name registration contains the authoritative name servers for the domain.
  • Those name servers relate the domain name to the IP address of the hosting server.
  • The hosting server listens for and responds to requests (http(s), email, ssh, ftp, etc) for the domain name.

If so, use their interface to set the DNS records to reflect the IP address of your VPS, then transfer the content of your website to the VPS and configure the web browser to respond to requests for your domain. If you're also doing mail, then you'll need to configure an email server to process your domain's email...actually, you should do the transfers and configuration first, then change the DNS records so that the service of the domain won't be interrupted.

Quote:
Originally Posted by dcole1990 View Post
Can cPanel account from shared hosting even be transferred to VPS?
Not exactly. If you're running cPanel on your VPS, you could configure it to work as it does on your shared hosting provider...but that sounds like a lot of work for a (presumably) single-user system.

Do you know how, without cPanel, to configure a web server and an email server and ssh/sftp to maintain the web content?
*** *** ***
About your named.conf...as I said, I've quit doing my own DNS, so I'm a bit rusty, but these things pop out...
You don't "own" 185.62.75.120 (if that's the real IP address), you're only renting it, so you can't define the rDNS for it. That will need to be done by itsoft...or they will need to set things up so you can manage the rDNS...again, rusty. Hopefully someone will help.

That domain and IP are responding with a page from a cPanel installation. Is that the IP of your shared hosting server?

Maybe we need to ask, What are you trying to accomplish by using a VPS instead of a shared hosting service?
 
Old 05-27-2018, 08:08 AM   #8
dcole1990
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Hello scasey! Thank you for your reply.

By "default nameservers" I think on nameserver of the shared VPS hosting where domain is hosted and register. If I understood you correctly now that I reverted it to those servers, I should change DNS records and point them to VPS? Regarding the transfer, that is the thing I am not sure how to do, but I can give it a go, no worries.


Quote:
Do you know how, without cPanel, to configure a web server and an email server and ssh/sftp to maintain the web content?
Well, no to be honest, but can also look it up and try to do it, I am not looking for someone to hold my hand during the whole process , just wanted to be pointed at the right direction.

________________________________________________________________________________________

Regarding IP address mentioned above, yeah that is the IP of the VPS itself. So domain and IP in named.conf are from shared hosting where domain and cPanel account are located.

And to answer your last question. Nothing special to be honest. I would just like to be able to take care of domain without having to use cPanel account every time ( it's weird I know, everyone likes cPanel ), but there is something in CLI that i prefer better haha :P

Cheers!
 
Old 05-27-2018, 08:38 PM   #9
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
If you have registered a domain, then it's registered. If someone types your domain into a browser, or uses it for email, the domain registrar's DNS server will translate the domain to your ip, and the request will go to your vps which will provide the service requested.
 
Old 05-28-2018, 07:22 PM   #10
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,376

Rep: Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551
The name servers associated (authoritative for) with your domain are ns1.mydataknox.com and ns2.mydataknox.com
Those name servers resolve the domain name to 185.62.75.250

Are those your "private" name servers? Is the 185.62.75.250 address your VPS or your shared host?

Last edited by scasey; 05-28-2018 at 07:27 PM.
 
Old 05-28-2018, 07:26 PM   #11
scasey
Senior Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.7.1908
Posts: 4,376

Rep: Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551Reputation: 1551
Quote:
Originally Posted by AwesomeMachine View Post
If you have registered a domain, then it's registered. If someone types your domain into a browser, or uses it for email, the domain registrar's DNS server will translate the domain to your ip, and the request will go to your vps which will provide the service requested.
That may be true with some registrars...for example, I believe that both GoDaddy and Network Solutions assume that if you register a domain with them, you will be hosting it with them by default. It is not, however, true in all cases. Domains can be registered without providing an authoritative domain name server for them, in which case, they'll never work, of course.
 
Old 05-28-2018, 09:16 PM   #12
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Whenever I've registered a domain it just worked. I could host it anywhere I pleased, and I didn't worry about DNS at all. My records just propagated through the DNS system.
 
Old 05-29-2018, 04:08 AM   #13
dcole1990
LQ Newbie
 
Registered: May 2018
Posts: 5

Original Poster
Rep: Reputation: Disabled
Ok, here is what I did guys. Nameservers are reverted to default ones of shared hosting, through cPanel of shared hosting in A records of the domain I added IP of my VPS and domain is still working correctly. Let's say I'll leave it like that.

Now, I believe that I need to create backup of whole cPanel account in order to be able to transfer it to VPS? And the I just upload it, correct?
 
  


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
LXer: Moving from Shared to VPS Hosting Everything You Need to Know LXer Syndicated Linux News 0 10-19-2016 06:20 AM
Installed Varnish, Migrated my site frm shared hosting to VPS -Sudden Loss in Traffic dreamcoder Linux - Server 2 08-22-2012 06:32 PM
How to migrate email server from shared hosting to Linux VPS dreamcoder Linux - Server 2 08-04-2012 03:30 PM
Shared or Dedicated or VPS or Cloud hosting to host a custom PHP application vikram_cvk Linux - Server 1 02-06-2012 07:01 AM
Apache and FTP vps to work more like godaddy shared hosting fishdink Linux - Server 1 06-19-2009 08:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:18 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration