If you like DNray Forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...

 

Domain DNS A type record

Started by Beaker, Sep 28, 2022, 02:33 AM

Previous topic - Next topic

BeakerTopic starter

Hey there!

The current website is hosted on Apache and can only be accessed through a specific IP address in the format: xхx.xхx.xхx.xхx:xхxx. However, it would be preferable to access the website through a regular domain, or in this case, a subdomain.

To do this, I'm trying to set up a DNS record of type A on the hosting. The problem is that the current DNS record only indicates the server's IP address without any port. I've researched on how to set it up using srv but couldn't figure out how to fill in the correct information.

Do you have any suggestions on how to correctly set up a DNS record of type A or utilize srv? Would it be necessary to record the IP address without a port at the same time?
  •  


brandsmith

I wasn't aware that it was possible to steer ports through DNS records. In order to configure a reverse proxy, one would need VPS web hosting or transfer the site and steer the ports on the router.

Personally, I don't think using DNS is the best way to resolve this issue. Instead, I would recommend using HTTP REDIRECT 301-302 or Nginx.

For HTTP REDIRECT, you would need to host the desired subdomain somewhere where it can be connected to on port 80. From there, you can make an HTTP redirect to http://хх.ххх.ххх.ххх:ххх. This way, when someone enters the subdomain, they will be automatically redirected to the desired address with the port.

Alternatively, for Nginx, you can configure it to receive the required domain and then proxied to xx.xхx.xхx.xхx:xхx. This way, clients will only see the domain and the address with the port will be hidden between Apache and Nginx.
  •  

siyajoshi

Hey there!

The A-record (Address record) is used to indicate a specific IP address of the domain name. This record is essential for the site to function properly. When a user enters the site's name in the address bar of their web browser, the system utilizes this record to determine which server to contact for information.

Similarly, the AAAA record is an IPv6 equivalent of the A-record. It specifies the external IP address in IPv6 format.

Here's an example:
Hostname Record type Record value
eternalhost.net . A 194.51.0.6

And for the AAAA record:
Hostname Record type Record value
eternalhost.net. AAAA 212:12:2127:1:211:4eef:fe 10:b17

It's important to make sure that both A and AAAA records are properly set up to ensure the smooth functioning of the website.
  •  

Abessethoulse

You have a website hosted on Apache, and it's only accessible through a specific IP address. This is likely due to the fact that the IP address is not publicly routable, or it's behind a firewall that only allows access through a specific port.

To set up a DNS record of type A, you'll need to create a new record that points to the IP address of your server. However, there's a catch. Since your IP address is not publicly routable, you'll need to use a technique called "hairpinning" or "loopback" to make it work. This involves creating a DNS record that points to the IP address of your server, but also specifies the port number that your website is listening on.

The problem is that most DNS providers don't allow you to specify port numbers in DNS records. This is where SRV records come in. SRV records are a type of DNS record that allows you to specify a service (in this case, your website) and a port number. By creating an SRV record that points to your server's IP address and the port number your website is listening on, you should be able to access your website through a regular domain.

Here's an example of how you might set up an SRV record:

Service name: _http
Protocol: tcp
Priority: 0
Weight: 0
Port: 80 (or whatever port your website is listening on)
Target: your-server-ip-address
Keep in mind that not all DNS providers support SRV records, so you'll need to check with your provider to see if they do.

If your DNS provider doesn't support SRV records, you may need to use a different technique to make your website accessible through a regular domain. One option is to set up a reverse proxy server that listens on a publicly routable IP address and forwards requests to your server. This would allow you to create a DNS record that points to the reverse proxy server, and then have the reverse proxy server forward requests to your server.

Another option is to use a load balancer or a content delivery network (CDN) that can handle the complexity of your IP address and port number. These services can often provide a publicly routable IP address and can handle the forwarding of requests to your server.

In any case, it's worth noting that setting up a DNS record that points to a non-publicly routable IP address can be a bit of a pain, and may require some creative problem-solving. But with the right tools and a bit of persistence, you should be able to get your website accessible through a regular domain.
  •  

larigoule

An A record only points to an IP address, no port involved - ports are outta scope for DNS. For your case, an SRV record could work to specify the port, but it's often a pain since not all clients respect SRV lookups (mostly used for services like SIP or Minecraft).

You'd set the SRV record with a format like _http._tcp.yoursubdomain.yourdomain.com with priority, weight, port (e.g., your xхxx), and target (the A record hostname). Still, most browsers ignore SRV, so you're better off configuring a reverse proxy or redirect on Apache to handle the port internally and keep the A record clean with just the IP. No need to mess with port in DNS - handle that server-side, mate.
  •  


If you like DNray forum, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...