DNS entry for third level domain - apache

I am trying to create a third-level domain virtual host on my server. I hope the configs are set up correctly, but I am getting a ERR_NAME_NOT_RESOLVED error.
I have read that I have to "add DNS entry" somewhere so that the name would get resolved, but how do I do that? Where do I do that? The server is running on Ubuntu .

I suppose you get that ERR_NAME_NOT_RESOLVED error from Chrome. This means that Chrome is unable to find the subdomain in DNS.
You are correct, registering your subdomain in DNS will require DNS changes. Specifically, you have to add a DNS A resource record for your subdomain to become "visible" to browsers over IPv4. For IPv6, add an AAAA, too. Both record types point to an IP address and it will be the IP address of your web server. (Technically, you can also use a CNAME type record, but make sure to read up on how that works.)
Subdomain DNS will be served by the authoritative DNS servers for your domain, so you can register the required record(s) through your DNS service provider. If you are not sure who they are, look up the NS records for your domain, this will give you the list of authoritative name servers for your domain and you can work from there.
I understand you have already configured your Apache to work with the subdomain, so setting up DNS completes the setup process.

Related

Redirect IP to domain issue

I have following domain name air8kissen.de. When I type in that domain name in browser it gets redirected to its IP address 178.128.117.168. The problem is that I setup SSL for domain name and since IP dont have SSL it shows the warning sign. When I accept to risk visiting the website, it redirects me to my domain name.
I have setup all necessary CNAME and A records inside Digitalocean domain setup and have no idea why it shows the IP address first time I visit to domain.
What should I do to fix this?
Cheers
This is not a DNS or SSL issue, You need to setup the Virtual Host for your domain at your webserver, and check any redirection rules placed at your webserver level.

Configuring domain and a server

So I have a domain
1. somedomain.com
2. server ipv4 address
On Google domains I have:
Name TYPE DATA
# A 11.85.258.61
Cloudflare:
TYPE Name Value
A pamperyouanywhereapi.com 11.85.258.61
CNAME www pamperyouanywhereapi.com
But I get the error below When I try to access my app:
This site can’t be reached
This is the correct setup. Make sure you wait out up to 48 hours when doing a new website.
Set up is correct. But I think my tomcat is blocking Cloudflare. I went through this article.
And the commands the author has provided in that article, they did not give me positive results.
Wrong article; but if I recall it was telnet your server's ip address.

Cant access my website through its IP address

I have hosting with godaddy with a private IP address. I am able to access my websites and others via the domain name, but not via IP Address.
I am now trying to access the HTTP via port 80 but it gives an error that the website is not setup.
Are there any workarounds on turning allowing accessing the website and other folders through the IP address over http?
This sounds to me like you were on a managed webpack that grants you access to the to-be-served content but not to the webserver or its config itself.
What you are experiencing there is an effect of a technique called virtual-hosts in which multiple sites are tied to one IP address. For this to work in the realm of HTTP, the Host header got introduced in HTTP/1.1. It allows clients to send a domain name for which they want to receive content.
If you request a raw IP, though, the Host header won't look like Host: example.com but rather like Host: 123.45.67.89. The server will not be able to associate a domainname with this as it is unlikely to be found elsewhere in the request. Therefore, it will be forced to serve content out of its default document directory which usually contains further documentations regarding the further configuration of the webserver in question. Linux distributions like to add additional informations specific to them. Check if you see any mentioning of e.g. Debian, RedHat, or Centos.
I am not sure if this is fixable. Usually webservers like Apache support IP-based virtual hosts. If a masshoster like godaddy is really going to address this is uncertain. Try to contact their support and see.
1]If you are using host headers, make sure you have a DNS entry pointing your URL to your IP
2]Telnet port 80 from a machine outside your network.If it fails then check with your ISP that port 80 should not block in firewall.

website can be accessed using ip but not with the url(domain name) in wamp

from default httpd.conf to updating the host file and httpd.conf i tried but the website fails to open with domain name give
in host file
<my current public ip address> <domain name>
in httpd.conf
Listen [my public ip]:port
then restart of wamp server and finally restart of PC and of-course change of ip is done in above all.
But of no use
Please help
Thanks for time and response
Aaron,
I think you are misunderstanding the function of the HOSTS file.
The hosts file acts a little like a local DNS Server. Any changes you make to it will only effect the single PC that you made the change on.
What the HOST file actually does
When windows starts it starts a service called DNS Client also known as dnscache. That service reads the HOSTS file and seeds the dnscache with any domain names you put in it and the ip that should be connected to for each domain name.
Any program (the browser in this case) that wants to connect to a domain, checks this cache first, to reduce accesses to an actual DNS Server out on the web and therefore speed up the conversion of domain name to Ip Address.
So if you want external users, i.e. anybody on the internet to be able to access your site you have to either purchase a real domain name and get it pointed to your WAN ip address, or use a Dynamic DNS service like DYNDNS or NO-IP, to mention only a few, and get that dynamic dns service to point to your WAN IP.
You will also have to change your Apache config so it will serve that domain name, my suggestion would be to create a Virtual Host to do this.
This post may help with the process of creating a Virtual Host

How are creating subdomain by adding A record is different from editing /etc/hosts

I was going through this answer about how to create subdomain. I used to create subdomain in my Linode server by adding a A record and then creating a virtual host. What different does it makes to create subdomain using A record and by editing /etc/hosts. Which is better way ? Also should I use CNAME record for it ?
Editing /etc/hosts just makes the subdomain resolvable on the local machine only. If your machine is a DNS authority for your domain, then adding the A record on the server will make that subdomain available for anyone. If your machine is not the DNS authority for the domain, then you need to create the record in the DNS server wherever that is, maybe a corporate DNS or GoDaddy or where you bought the domain from.
As for A vs CNAME, an A record means you want to resolve the subdomain to an IP address. The CNAME is essentially an alias that can resolve to a different DNS record in the zone file. You may have www.abc.com as a CNAME to your A record of abc.com. It is used to prevent dependencies on IP addresses except where necessary. If you have a domain with lots of subdomains that all go to a small number of servers, if an IP address changes, and all of those records are A records, it means a lot of DNS changes. If they were CNAME records, you only have to change the specific A records that changes.