Learn about Centmin Mod LEMP Stack today
Become a Member

Cloudflare DNS Very much newbie DNS questions

Discussion in 'Domains, DNS, Email & SSL Certificates' started by Cervent, Aug 2, 2016.

  1. Cervent

    Cervent New Member

    11
    3
    3
    Jul 21, 2016
    Ratings:
    +3
    Local Time:
    7:14 PM
    N/A
    MariaDB 10
    This is probably going to be a very newbie (or dumb) question to most of you but that's why I'm asking... because you probably have the answer. ;)

    I have a Vultr vps setup and running as I want, but now I would like to be able to access via a domain name instead of the IP. I already own a domain and it's already being used for my main website, however I would like to use a subdomain to access my new vultr site if at all possible.

    Example would be MYDOMAIN.com goes to my main site, but TEST.MYDOMAIN.com goes to my Vultr server. Is this possible or do I need to buy another domain name?

    To make things even more complicated (or easier?) is I'd like to use CloudFlare for TEST.MYDOMAIN.com to take advantage of DDoS protection as well as hide where TEST.MYDOMAIN.com is being hosted.

    Actually I would like to use CloudFlare even if I have to buy a new domain name for my Vultr server. I see Vultr has a DNS page but that points to their DNS servers so I'm sure how I would setup TEST.MYDOMAIN.com (or NEWDOMAIN.com) to use cloudflare.

    Sorry if this is just a confusing mess... it pretty much is in my head too. :p
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    subdomains are just additional dns records in your main domain's zone file so no need for a new domain purchase

    google leads to How do I add a subdomain? – CloudFlare Support for CNAME or you can use a A record to point subdomain to server IP address too
     
  3. Cervent

    Cervent New Member

    11
    3
    3
    Jul 21, 2016
    Ratings:
    +3
    Local Time:
    7:14 PM
    N/A
    MariaDB 10
    Thank you @eva2000. I tired to add a CNAME but I get an error stating CNAME's can not point to an IPv4 address.

    I just tried adding an A record but it seems this won't work for me needs either as the main domain isn't using CloudFlare and does use an SSL and the site header HSTS has been added. The new VPS only has a self signed cert. When I tried to access the TEST.MYDOMAIN.com chrome reports the following...

     
  4. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    cloudflare needs all domain records including main domain with them, so if main domain is elsewhere, you need to use main domain's dns registrar to add subdomain

    or move main domain to cloudflare too
     
  5. Cervent

    Cervent New Member

    11
    3
    3
    Jul 21, 2016
    Ratings:
    +3
    Local Time:
    7:14 PM
    N/A
    MariaDB 10
    Well I haven't even started trying with Cloudflare, so even putting them aside this won't work with HSTS enabled on the main domain and not on the sub - or at least without a valid SSL for that subdomain.
     
  6. eva2000

    eva2000 Administrator Staff Member

    28,942
    6,570
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,751
    Local Time:
    9:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    just move all of them to cloudflare so covers all domains and subdomains for SSL
     
  7. Cervent

    Cervent New Member

    11
    3
    3
    Jul 21, 2016
    Ratings:
    +3
    Local Time:
    7:14 PM
    N/A
    MariaDB 10
    That's exactly what I'm looking into now and reading their FAQ to see how that will affect the SSL already purchased for the MYDOMAIN.com.

    The main site won't benefit much from it since I have a mail server running on that site but I'm not really worried about it as my main concern is people snooping around the Vultr server.