How to create a subdomain manually - .htaccess

I want create a subdomain that is not possible to create on cPanel (the word "admin" is reserved by Hostinger), it is not in use and I want host my admin panel on this subdomain, I need create it by myself.
I have access to DNS recorder, but I don't know how redirect it to correct folder (same IP address for all). I created an A recorder on DNS, and it's return:
Not Found
The requested URL / was not found on this server.
I'm using CloudFlare.

Related

Custom domain and how to access site as http://

In Azure, I have purchased a Custom Domain and the configuration has been done automatically - all good till now however the site is accessible only using: www.sitename.com
If I access it using http://sitename.com only, it is not working.
For info, I tried to remove the CNAME however didnt allow.
Suppose I dont want to use the wwww, how can I do ?
Thanks.
If you want to access your website with http://sitename.com, you have to create the A record and enable the A record mapping in the app. For how to map an A record, this doc is for your reference.
1.Copy the app's IP address
2.Create the A record
An A record to map to the app's IP address.
A TXT record to map to the app's default hostname.
3.Enable the A record mapping in the app
The custom domain you configured is not secured. You'd better click on "Add binding" to bind an existing custom SSL certificate to your app. For more details, you can refer to the doc.
The in the DNS for domain sitename.com the A record to is what make http://sitename.com works.
If you want http://www.sitename.com to work you HAVE TO have a www CNAME record.

How do I configure Google Domains for Dynamic DNS?

I have a domain name on Google Domains that I want to point to my website running on my raspberry pi server at home. My public IP address is dynamic, and I cannot figure out how to keep the domain pointing at my IP when the IP is updated. Is anyone familiar with Google Domains dynamic DNS configuration?
I initially configured a "Custom Resource Record" on the DNS tab of Google Domains because the description says "Resource records define how your domain behaves. Common uses include pointing your domain at your web server or configuring email delivery for your domain." That works until my IP changes, then the domain name no longer points to the correct IP.
Next, I tried adding a "Dynamic DNS" Synthetic record to my Google Domains DNS configuration. I have a cron job that runs on my server every 5 minutes and runs the following (with USERNAME and PASSWORD set to match the credentials generated by Google Domains synthetic record):
curl https://$USERNAME:$PASSWORD#domains.google.com/nic/update?hostname=$HOSTNAME&myip=
When the curl command runs, it does successfully update the IP address in the Synthetic Record, as I would expect. But, the IP address in the "Custom Resource Record" does not update and the domain no longer points to the correct IP. I need to manually change the Custom Resource Record to the correct IP for it to work again.
Actually figured this out. I was giving the synthetic record a made up subdomain because I thought I had to and the solution was to simply leave it blank.
If you want to configure the entire domain, rather than just a subdomain, place '#' (without the quotes) in the sub-domain field. This will redirect everything

How to allow CNAME pointed to my server / how to use subdomain for a different server?

We create custom web apps for businesses and for the first time a client of ours has asked that instead of using our subdomain and instead of using a custom domain for their web app they would like to use their own subdomain for a domain currently hosted on another server.
For instance our domain is webapp.com and their domain is business.com. They would like app.business.com to be point to our name servers so we can continue hosting the web app for them.
I know it's possible to do this because we currently have outgoing CNAMEs on our server for help desks, etc, that aren't hosted on our own server but are using subdomains of ours.
Could you help me with what our client has to do on their zone editing side and what we need to do on our WHM/cPanel side to allow this?
NOTE: We had the client create a CNAME for app.business.com. pointed to our nameserver ns1.webapp.com and then we created an add-on domain for business.com and subdomain for app.business.com but when you try to visit app.business.com it gets the "Sorry!" cPanel page.
Thank you!
Alright I figured out how to do it on my own after a lot of testing & thought I'd post here to help others out in case they run across this in the future.
For the server with the subdomain on it have them create an 'A' record for that subdomain pointing to your server's IP address like so:
subdomain.business.com. ((note the extra period at the end is required))
TTL: 14400
Record Type: A
Pointing To: Your server's IP address.
Now on your server's cPanel you will need to create an addon domain for THAT subdomain (ie subdomain.business.com) - not for the actual business.com domain but for the entire subdomain subdomain.business.com with the folder being the root folder wherever you would like it to show.
That worked for me!
The CNAME should not point to your nameserver but your subdomain f.e. client1.webapp.com.
An other solution could be to add the subdomain app.business.com to your server and the client add an A record for the subdomain to your ip.

How to direct all newly registered domains to default holding page

When you register a domain with, let's say GoDaddy, and use their nameserver your domains points to a default holding page.
I run my own nameserver and when I register new domains I point my domains to my own DNS.
How do I set up a holding page so that all newly registered domains point to a default holding page.
Any pointers will be helpful.
Tx
I believe what you are asking is that you want to be able to purchase a domain, update it's nameservers to point to your DNS server and then have a default webpage "holding page" for them?
You can do this, but you will need to configure DNS. DNS servers, by default, do not give out answers that they do not know the answer to. There is a mechanism called dns hijacking, but it is very frowned upon. So lets assume that for every newly purchased domain you do configure DNS. To create the "holding page" simply point your default records (domain, www.domain, etc). to a web server's ip address.
On the web server do not use virtual hosts. A virtual host will give a specific web folder to a request with a given host header. This means that if you request foo.com you will get the foo.com folder. If you request bar.com you will get bar.com folder, etc. If you do not configure your webserver for virtualhosts then the web server will simply return the default web folder.

very simple -- how do i setup a subdomain with 1&1 domain provider + hostgator hosting?

Everytime I try to create a subdomain with this combo, it simply says the page doesn't exist. I have the subdomain directory created, so I'm not sure what I'm doing wrong. for example if I want
subdomain.domain.com, then
domain.com/subdomain will work, but
subdomain.domain.com won't work.
Any insight?
Firstly you will need a DNS record for you subdomain. This can be a CNAME record if you just want the the subdomain to be an alias of the main domain (Canonical Name). If you want the subdomain to be hosted on a different IP address or server then you need a new A record.
From the sounds of it you want a CNAME record for your subdomain created in your DNS manager, and then you want to configure your web server to look at the host headers to map to the sub directory you created. How you go about this depends on the type of web server.

Resources