-1

In my DNS settings, I want to point this website domain - www.websiteA.example to the following IP address which has a path http://xxx.xxx.xxx.xxx/pathA (this is a VPS, if it makes any difference)

Is this possible?

If so can you please provide more information on how I can achieve this?

Patrick Mevzek
  • 10,581
  • 7
  • 35
  • 45
pedron
  • 1
  • 1

2 Answers2

3

That's not possible, DNS only handles mappings between host or domain names and IP addresses; the path only makes sense for web sites, it's managed by the web server and DNS has nothing to do with it.


A possible solution is to put something (f.e. a minimal webserver) at www.websiteA.com that performs a HTTP redirect to http://xxx.xxx.xxx.xxx/pathA.

Massimo
  • 72,827
2

TL;DR

No you can't.

The bigger picture

DNS only maps names to addresses using A records when it comes to IPv4 and AAAA records when you're dealing with IPv6.

I'm assuming that you have a web server that shall serve different documents for two distinct domains. If I'm right, then I suggest you look into the concept of virtual hosts/servers. As an example, here is the documentation for Apache httpd's virtual host configuration. The basic idea is, that you set up multiple A/AAAA entries with the same address, but different names in your DNS pointing to your web server. Web servers can - since the HTTP protocol carries that information - find out with which name a request was made with and decide what documents to serve accordingly.

Timor
  • 311
  • 2
  • 11