Summary: You cannot make it work for everybody unless you use a domain name. But if you just treat 198.51.100.55
as if it was yet another domain name, it will work for most users - at least for the time being.
My recommendation is to create a domain for your test site. Possible options include: acquiring a new domain, using a subdomain of one of your existing domains, using a free subdomain from one of the various providers of such domains.
The URL http://198.51.100.55/test_site/html/index.html
will never be accessible to the entire internet.
There are new networks being deployed without IPv4. In order to allow clients on such networks to access IPv4-only resources techniques such as DNS64 and NAT64 are being used. If the name of your server was test.example.com
the connection flow for such a client could work as follows:
- The browser sends a query to the ISPs DNS recursor asking for the AAAA record for
test.example.com
- The ISPs DNS recursor asks the authoritative server for
example.com
for the AAAA record for test.example.com
- The Authoritative server replies that no such record exists.
- The ISPs DNS recursor falls back to DNS64 and ask the authoritative server for
example.com
for the A record for test.example.com
- The Authoritative server replies with
198.51.100.55
- The DNS recursor concatenates the prefix of one of the ISPs NAT64 gateways (let's call it
2001:db8:c481:4960:88df:da01::/96
and the IPv4 address. The result is 2001:db8:c481:4960:88df:da01:198.51.100.55
AKA 2001:db8:c481:4960:88df:da01:c633:6437
.
- The DNS recursor sends a response to the browser saying the AAAA record for
test.example.com
is 2001:db8:c481:4960:88df:da01:c633:6437
.
- The Browser sends a SYN packet to the NAT64 on
2001:db8:c481:4960:88df:da01:c633:6437
.
- The NAT64 converts the SYN packet from IPv6 to IPv4 by stripping of the first 96 bits of the destination IP address and substituting its own IPv4 address as source.
- The communication continues with the NAT64 translating every packet in the TCP connection.
But the moment you try to do this with an IP address rather than a domain name, it breaks down. The browser will never send any DNS request, so it never learns that 198.51.100.55
is to be substituted by 2001:db8:c481:4960:88df:da01:c633:6437
. Instead the browser will try to connect to 198.51.100.55
, but the host has no IPv4 route, so the kernel will tell the browser that the server is unreachable.
The only way you can make the site available to users on such a network (without breaking anything else) is by having a domain name for your site.
If you are satisfied with making your site available only to a large percentage of the internet (which will keep getting smaller over time), then you can simply treat 198.51.100.55
as yet another domain name and configure a virtual host accordingly.
It would look something like this:
<VirtualHost 198.51.100.55:80>
ServerName 198.51.100.55
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>