How to access the subdomain of an IP address in the browser?
This isn't possible via firefox. However a work around is to edit your OS hosts file see: wikipedia.
Create or edit and add a line like:
192.168.1.100 subdomain.example.com
Remember to remove the line when you're done!
You can't mix a subdomain (DNS name) with an IP (no DNS name)
Try to use /etc/hosts file. For instance:
# IP Hotsname
2.1.33.111 subdomain.example.com
For Firefox It's ok but Chrome resolves names in a fancy way.
All browsers will return an error for this. The reason is that subdomains are part of the DNS (Domain Name Service) system, where IP addresses are related to the underlying IP protocol.
The best way to think of this relationship is that domains (including subdomains) are human-readable labels which DNS then allows you to point to IP addresses. It would not be very catchy to have an IP address as your website on a TV ad, for example.
There is much more detail on DNS and IP addresses if you want to delve into more detail than this.
IP addresses don't support subdomains. If your goal is to serve several application on server without an assigned domain, the best way is to use ports:
2.1.33.111:8080
Some ports may already be in use or blocked for security reasons. If you need a list of some recommended ports, you could try using the same ones that Cloudflare supports.
HTTP:
- 80
- 8080
- 8880
- 2052
- 2082
- 2086
- 2095
HTTPS:
- 443
- 2053
- 2083
- 2087
- 2096
- 8443