non-www A record

xcwervee56

New member
Joined
Sep 21, 2021
Messages
6
Hi all,

I have been requested to add a 'non-www' record to our directadmin but I don't seem to be able to do that, as it always wants a value in the left column

'You must provide a valid name and value'


Am I missing something here?
 

xcwervee56

New member
Joined
Sep 21, 2021
Messages
6
Thanks for the quick reply. I've found that it works fine redirecting to domain.com but now if you type www.domain.com

I seems to be going to http:// as opposed to https:// so I suspect something needs changing on the webhost side to allow http
 

xcwervee56

New member
Joined
Sep 21, 2021
Messages
6
We don't host the website, another company does. I added a 301 site redirection to go to https://'theirdomain'.com which is all I should need, right? I shouldn't need an @ A record or www A record pointing to their IP address?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
7,235
Location
Maastricht
With an A record, the visiting user will be directly set to "theirdomain.com" and with a redirect they will first visit your server and then be redirected to "theirdomain.com". So the effect is the same, but might take a few milliseconds longer.

But a redirect is only for the website, not for FTP or mail or anything.

If you also want to set FTP and mail to that other company, you will have to change some DNS records.
 

xcwervee56

New member
Joined
Sep 21, 2021
Messages
6
With an A record, the visiting user will be directly set to "theirdomain.com" and with a redirect they will first visit your server and then be redirected to "theirdomain.com". So the effect is the same, but might take a few milliseconds longer.

But a redirect is only for the website, not for FTP or mail or anything.

If you also want to set FTP and mail to that other company, you will have to change some DNS records.

Thanks Richard. If site redirection is enabled AND there are @ and www A records, would one method take precedence over the other? If so, is there a recommended way, and should one be removed to prevent conflict?
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
7,235
Location
Maastricht
DNS records always take precedence over site redirections, because DNS records are always used to lookup a domain.
So in fact it doesn't matter if you use both, because when using DNS records, the redirection isn't looked at anymore. So there is no conflict.
Using DNS can just make things slightly faster.

It mostly depends if you handle mail locally on your server or not

With DNS you can't only use the www A record, because people also visit "domain.com" instead of "www.domain.com" and they will arrive at your server again. So you have to put both domain.com. (mind the trailing dot) and the www A records to the ip of the other server. And also the FTP record otherwise they can't upload files to their website when using the domain name as servername in ftp.

If you keep handling the mail then be sure your mail and MX records are still pointing correctly.

I think DNS is the recommended way but it's up to you. I also got some domains with a redirect, and some with DNS.
 

xcwervee56

New member
Joined
Sep 21, 2021
Messages
6
DNS records always take precedence over site redirections, because DNS records are always used to lookup a domain.
So in fact it doesn't matter if you use both, because when using DNS records, the redirection isn't looked at anymore. So there is no conflict.
Using DNS can just make things slightly faster.

It mostly depends if you handle mail locally on your server or not

With DNS you can't only use the www A record, because people also visit "domain.com" instead of "www.domain.com" and they will arrive at your server again. So you have to put both domain.com. (mind the trailing dot) and the www A records to the ip of the other server. And also the FTP record otherwise they can't upload files to their website when using the domain name as servername in ftp.

If you keep handling the mail then be sure your mail and MX records are still pointing correctly.

I think DNS is the recommended way but it's up to you. I also got some domains with a redirect, and some with DNS.
Thanks so much guys for the prompt responses, great forum!

I've now removed the redirect and left both the @ and www A records in place. It was sometimes working then sometimes not, so I'm wondering if perhaps the redirect was sometimes taking effect and that was the issue? All seems to be well now with just the A records in place.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
7,235
Location
Maastricht
You're welcome.

Please next time... don't quote full posts. ;)

If you encounter other issues, feel free to ask. We're here to help.
 

razu55

New member
Joined
Nov 23, 2021
Messages
2
DNS records always take precedence over site redirections, because DNS records are always used to lookup a domain.
So in fact it doesn't matter if you use both, because when using DNS records, the redirection isn't looked at anymore. So there is no conflict.
Using DNS can just make things slightly faster.

It mostly depends if you handle mail locally on your server or not

With DNS you can't only use the www A record, because people also visit "domain.com" instead of "www.domain.com" and they will arrive at your server again. So you have to put both domain.com. (mind the trailing dot) and the www A records to the ip of the other server. And also the FTP record otherwise they can't upload files to their website when using the domain name as servername in ftp.

If you keep handling the mail then be sure your mail and MX records are still pointing correctly.

I think DNS is the recommended way but it's up to you. I also got some domains with a redirect, and some with DNS.
Hello @Richard G

I don't get it... How can I set redirection from www.domain.com to domain.com ???
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
7,235
Location
Maastricht
Hello @razu55 please also do not quote full posts. I would have understand the question without the post too. :)

Anyway, there are 2 ways to do this.
1.) Via the DA panel, in the domain settings, you can choose there to force nothing, force with www or force without www.
2.) Via a redirect in a .htaccess file in the public_hml directory of the domain.
 

Richard G

Verified User
Joined
Jul 6, 2008
Messages
7,235
Location
Maastricht
Post some screenshots.
Which error notices do you see?
What do the logs say?
Which distro are you using?
 
Top