Sub domain as website domain

Discussion in 'Server Operation' started by Oitsuki, Dec 4, 2020.

Tags:
  1. Oitsuki

    Oitsuki Member

    Hello,
    I just make a new server and the last time I was a subdomain as a website. But I do not remember the process.

    Website : Create a subdomain : demo.domain.com
    In my dns domain.com
    DNS : I tried to create with A option an Hostname : demo.domain.com. => do not work
    DNS : I tried to create with CNAME option an Hostname : demo.domain.com. and target : demo => do not work
    I am lot a little. Someone can explain the process to create a subdomain as a website domain.

    Inside domain.com, there is an option : Auto-Subdomain, what is the best option for that ?
    Other point ?
    Thank you.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What does not work? Creating the record in DNS? The new FQDN does not resolve? The website does not work? Or something else?
    Auto-subdomain is for www. if I undestood what you asked. Usually best to leave it at www.
     
  3. nhybgtvfr

    nhybgtvfr Active Member

    i take it from the information you've given, you're using ispconfig, even though you don't actually say that.

    auto subdomain either creates the site with no subdomains whatsoever (even www. won't work), adds the www subdomain to a vhost,
    or adds the wildcard * to the vhost, so that main site will get displayed no matter what subdomain a visitor types into their browser (assuming the subdomain they typed exists in your dns and points to that server, or the * subdomain exists in your dns and points to that server)

    ok. assuming your domain is mydomain.com, for which you already have the website working, along with the subdomain www.
    and you want to create the subdomain, sub.mydomain.com.

    create the A record for the subdomain, sub ( or whatever other subdomain you want to use) in your dns.

    go to sites - websites - subdomain for website - add a new subdomain.

    parent website: mydomain.com
    host: sub ( or whatever other subdomain you want to use)
    domain: mydomain.com
    redirect type: no flag
    redirect path /sub/ /<or whatever other subdomain you want to use>/

    this will create the folder you specified in the redirect path in /var/www/mydomain.com/web/, in this case /var/www/mydomain.com/web/sub/ and this is where you put the site contents your want for that subdomain.


    or you can create it as a completely separate vhost, either as a full website, or using the subdomain (vhost) option if you have it enabled.


    also, are you absolutely sure that the dns A record doesn't work? if your only evidence is that the site doesn't display, that doesn't mean the dns is at fault.

    try using nslookup or dig to test the dns, or see what ip address ping, eg 'ping demo.domain.com' tries to use. (again, no reply does not mean dns isn't working. it's the resolving the fqdn to the ip address which is important here.)
     
  4. Oitsuki

    Oitsuki Member

    Hello,
    Thank you
    Yes of course, I use ispconfig
    I created a A dns under domain.com: demo.domain.com.
    In website menu for domain.com, I selected the option Auto-Subdomain : *.
    In website menu I created a domain: demo.cicshopping.org with selected the option Auto-Subdomain : *.

    I would to create a subdomain with a true website, ftp. without to pass by subdomain menu or alias menu.
    but I do not remember exactly to proceed.

    --------
    It's not a subdomain but an alias.
    parent website: mydomain.com
    host: sub ( or whatever other subdomain you want to use)
    domain: mydomain.com
    redirect type: no flag
    redirect path /sub/ /<or whatever other subdomain you want to use>/
     
  5. nhybgtvfr

    nhybgtvfr Active Member

    ok, now i have absolutely no idea what your trying to end up with.
    do you want a subdomain as a full standalone website? a subdomain? or an alias?

    please use the exact domain names and subdomains you want, i can't tell if domain.com is just an example you used and could be anything, or should also be cicshopping.org.

    also, dns is never going to work when the domain names haven't even been registered (cicshopping.org)
     
  6. Oitsuki

    Oitsuki Member

    Do you want a subdomain as a full standalone website? Yes exactly
    domain name : clicshopping.org
    sub domain : demo.clicshopping.org
     
  7. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Then you can simply create a new website using demo.clicshopping.org via ISPConfig and this will give that sub domain its own space /var/www/demo.clicshopping.org.
     
  8. Oitsuki

    Oitsuki Member

    Last edited: Dec 4, 2020
  9. nhybgtvfr

    nhybgtvfr Active Member

    you probably want to just use the specific www subdomain on clicshopping.org, and none on demo.clicshopping.org
    you could set the demo site to use www.demo.clicshopping.org, but it starts getting unwieldy. (it would also mean you'd have to create another A record as www.demo or www.demo.clicshopping.org. )
    with dns, you need to create the demo subdomain, and give it the ip of the server hosting that vhost.
    looks like it doesn't exist yet, just create the dns record the same way the www and mail subdomain A records were.
     
  10. Oitsuki

    Oitsuki Member

  11. nhybgtvfr

    nhybgtvfr Active Member

    ok. the name servers appear to be
    ns320556.ip-94-23-7.eu. and ns.kimsufi.com.

    ns.kimsufi.com doesn't appear to have any zonefile for that domain.
    clicshopping.org and www.clicshopping.org are ok on ns320556.ip-94.23-7.eu
    no demo, or www.demo
    doesn't seem to find demo.clicshopping.org.clicshopping.org either (which would resolve if you created the a record as demo.clickshopping.org without a trailing )
     
  12. Oitsuki

    Oitsuki Member

    Ok I do that, below the result on the test on demo.clichsopping.org on this website : https://pentest-tools.com/information-gathering/find-subdomains-of-domain# seems to be correct but https://demo.clicshopping.org/ do not work.

    can parameters
    Domain: demo.clicshopping.org
    DNS records (NS, MX, TXT, AXFR): On
    DNS enumeration: On
    Certificate Transparency Logs: Off
    Project Sonar (Rapid7): Off
    Bing search: Off
    Google search: Off
    HTML links search : Off
    SSL search: Off
    Reverse DNS search: Off
    Smart DNS search: Off
    IP information: False
    Web technologies: True

    Scan information
    Start time: 2020-12-04 14:32:49 UTC+02
    Finish time: 2020-12-04 14:33:05 UTC+02
    Scan duration: 16 sec
    Scan status: Finished

    and

    ; <<>> DiG 9.16.1-Ubuntu <<>> demo.clicshopping.org
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 22187
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 65494
    ;; QUESTION SECTION:
    ;demo.clicshopping.org. IN A

    ;; Query time: 59 msec
    ;; SERVER: 127.0.0.53#53(127.0.0.53)
    ;; WHEN: ven. déc. 04 13:37:05 CET 2020
    ;; MSG SIZE rcvd: 50
     
  13. Oitsuki

    Oitsuki Member

    and this
    ; <<>> DiG 9.16.1-Ubuntu <<>> +trace demo.clicshopping.org
    ;; global options: +cmd
    . 37680 IN NS d.root-servers.net.
    . 37680 IN NS c.root-servers.net.
    . 37680 IN NS b.root-servers.net.
    . 37680 IN NS j.root-servers.net.
    . 37680 IN NS k.root-servers.net.
    . 37680 IN NS g.root-servers.net.
    . 37680 IN NS m.root-servers.net.
    . 37680 IN NS f.root-servers.net.
    . 37680 IN NS e.root-servers.net.
    . 37680 IN NS h.root-servers.net.
    . 37680 IN NS l.root-servers.net.
    . 37680 IN NS i.root-servers.net.
    . 37680 IN NS a.root-servers.net.
    ;; Received 262 bytes from 127.0.0.53#53(127.0.0.53) in 27 ms

    org. 172800 IN NS a0.org.afilias-nst.info.
    org. 172800 IN NS a2.org.afilias-nst.info.
    org. 172800 IN NS b0.org.afilias-nst.org.
    org. 172800 IN NS b2.org.afilias-nst.org.
    org. 172800 IN NS c0.org.afilias-nst.info.
    org. 172800 IN NS d0.org.afilias-nst.org.
    org. 86400 IN DS 26974 8 2 4FEDE294C53F438A158C41D39489CD78A86BEB0D8A0AEAFF14745C0D 16E1DE32
    org. 86400 IN RRSIG DS 8 1 86400 20201217050000 20201204040000 26116 . HiFI/wPQQJB7SwAF+TKKcUjAxCSogoNHfd5WsSxBcXPS8ID6GX8qNdZs uXJVCl4oR1M76siD6u4OjrNM6LJAw/5rjxc2LqHJG8/XTdcRKFIYS+k7 nvggIHRBUPJPCo0MEoBgMAs2c21G1WCLBptgcoAUL3Yvva29k2Q5tEk8 CmsOHKmmWFc9mg+8IJv6y1+AasN9Szc1HQdHNc5u3mjqjwVZX/sFgZnz ilgtGMiYG3Y7RafuWrqjY3q9VTzY9XjZS9CQGkrz5Fely7Ix1h094pVK tNHbNWoI4zoaHRzZd23OBqT1R2LNhAA1R2om2VAGNXpOcJKkkWqm9rh5 BuUaVg==
    ;; Received 787 bytes from 2001:503:c27::2:30#53(j.root-servers.net) in 83 ms

    clicshopping.org. 86400 IN NS ns320556.ip-94-23-7.eu.
    clicshopping.org. 86400 IN NS ns.kimsufi.com.
    d6n22mffurrkkhup4jscmntse266m0lq.org. 86400 IN NSEC3 1 1 100 332539EE7F95C32A D6N6GR81BV9D3CE1VSG6FN5BAU7UB671 NS SOA RRSIG DNSKEY NSEC3PARAM
    d6n22mffurrkkhup4jscmntse266m0lq.org. 86400 IN RRSIG NSEC3 8 2 86400 20201225123811 20201204113811 63858 org. pdwI0ImxESm8fV92wOjJkFXn7kaNro3TNDz+4K7Qvtc7IVw7m0o9DbFi 9MHsWNBYgZ3J4o11EChkwdvCMyViZFo4XbcHhlIPqJfH73k/2yH/p3VY RPscTBeG7ivYqo9oxZpinkRoBFlCkJSPdLA2hFh767ma9aPeeNF12r2J lb4=
    8l5oqefa7t1d7f53cvs58b9vlqpjgk58.org. 86400 IN NSEC3 1 1 100 332539EE7F95C32A 8L5STIP91HPL7BAM6EM8L6QNG53N2IRT NS DS RRSIG
    8l5oqefa7t1d7f53cvs58b9vlqpjgk58.org. 86400 IN RRSIG NSEC3 8 2 86400 20201223153324 20201202143324 63858 org. Iv389dcLXHH3XqILL1udQkB3ZmgAyLUl/CPbT/OuM85aOdzDnLqdNt9g wVr06C+q0TVIerTsrR9XcyTFelAYVN43O5sZ4XC7GvMTzkq7Oph4AkHq Ksx1X8F/+5FXC9c2BbdiHdC3vVhwUyE0LkY+Kqjl062DoLHpOL3ARaY3 4Co=
    ;; Received 618 bytes from 2001:500:48::1#53(b2.org.afilias-nst.org) in 51 ms

    ;; Received 50 bytes from 213.186.33.199#53(ns.kimsufi.com) in 39 ms
     
  14. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Indeed, a minute ago it did not work. But right now it does resolve from DNS:
    Code:
    $ host clickshopping.org
    clickshopping.org has address 45.38.74.119
    [email protected] ~
    $ host demo.clickshopping.org
    demo.clickshopping.org has address 45.38.74.119
    [email protected] ~
    $ host mail.clickshopping.org
    mail.clickshopping.org has address 45.38.74.119
    
     
  15. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    My signature has link to DNS tutorial, it explains how to test DNS is working properly.
     
    ahrasis likes this.
  16. Oitsuki

    Oitsuki Member

    Hello, you made a mistake on the name : clicshopping.org and not clickshopping.org

    host clicshopping.org
    clicshopping.org has address 94.23.7.166
    clicshopping.org mail is handled by 10 mail.clicshopping.org.

    host demo.clicshopping.org
    Host demo.clicshopping.org not found: 3(NXDOMAIN)
     
  17. nhybgtvfr

    nhybgtvfr Active Member

    post screenshots of your dns configuration
     
  18. Oitsuki

    Oitsuki Member

  19. nhybgtvfr

    nhybgtvfr Active Member

    demo may or may not be ok, can't see the end of the record to see if there's a trailing . or not, i would suggest changing it to just demo, to match the others.
    your nameservers for the domain are listed as ns.kimsufi.com and NS320556.IP-94-23-7.EU.
    your ns records are for ns.kimsufi.com and the ip4 address of ns.kimsufi.com
    you have nothing in your dns zone for NS320556.IP-94-23-7.EU. and that nameserver also appears to have nothing for your dns zone.
    you also shouldn't be pointing your (2nd) ns record to an ip address. it should always point to a fqdn.

    so you have problems with you're missing the actual 2nd nameserver in your dns, you're pointing a ns record to the ip of your 1st nameserver, not to the fqdn of your 2nd nameserver. and what should be your 2nd nameserver doesn't actually know anything at all about this domain.
     

Share This Page