-3

I have a public IP address that houses two applications e.g 197.18.2.48 houses 192.18.2.48/systems and 192.18.2.48/shop , I would like to map this two applications to my domain so that it reads

192.18.2.48/systems  -> systems.harris-dindi.com 
192.18.2.48/shop -> shop.harris-dindi.com

So the two systems with IP on the left should point to the subdomains on the right. I have tried using A records from the cpanel but it only accepts the IP Address. Please advise

H Dindi
  • 95
  • 2
  • The local path does not belong in the DNS config - it's part of the webserver configuration. DNS tells your users which server the (sub)domain lives at, and then you configure your webserver to use the proper path for each domain name. See http://serverfault.com/a/520201/120438 for a fuller explanation. – Jenny D Sep 16 '16 at 09:20
  • Should the A Records be for websites or what is this application? Please describe your Problem better, so we can help you better. – P to B Sep 16 '16 at 09:14
  • A website or a web application any which I would like it to run under a sub domain – H Dindi Sep 16 '16 at 09:16
  • Do you use apache for that? When yes use for that VirtualHosts here is an link how to create Virtualhosts. https://httpd.apache.org/docs/2.4/vhosts/examples.html – P to B Sep 16 '16 at 09:18

1 Answers1

2

CPanel is correct. DNS A records resolve names to IP addresses, not to applications. What you can do is add two A records pointing to the same IP address, like so:

systems.harris-dindi.com. IN A 192.18.2.48
shop.harris-dindi.com.    IN A 192.18.2.48

It is then up to the server running on 192.18.2.48 to route requests to the correct application, for example by the mechanism of name based virtual hosts.

Tilman Schmidt
  • 3,778
  • 10
  • 23