I created a site with Hugo and I hosted it as a gitlab page.
To assign my custom domain I followed the instructions of this document of gitlab.
I created three DNS records:
one of type A with name # and value 35.185.44.232;
one of type TXT with name # and value _gitlab-pages-verification ... for the verification of the ownership of the domain;
one of type A with name www and value 35.185.44.232.
If I access the site using the address https://example.com everything works normally; but if I log in using the triple W (www.example.com) I get from gitlab the error message 401 You don't have permission to access the resource. The resource that you are attempting to access is protected and you don't have the necessary permissions to view it.
How can I correct it?
Try a CNAME instead of a second A record for your WWW. subdomain. Having two A records - one that points to your naked domain and one that points to your WWW-domain is either causing redirect error or simply does not exist since it, as your origin's subdomain, must exist as a separate entity on GitLab OR you can not concern yourself with it by using a CNAME record as I previously recommended and using a directory-style (as opposed to a subdomain-style) setup for your site. Each has its own benefits as well as drawbacks. I use the CNAME method and have a WWW-subdomain setup on GitLab in order for my sites to grant that extra bit of security and privacy to visitors that having a TLS cert installed on the WWW-subdomain offers.
Related
there is an obligatory CNAME entry for one of my Google domains.
It reads:
_domainconnect.[mydomain].de CNAME 6 hours connect.domains.google.com.
What is this CNAME entry used for? As far as I have understood DNS this should not be necessary to find the actual server IP.
It is indeed not necessary for IP lookup. I suppose maybe Google itself uses it for something. I've found this https://community.cloudflare.com/t/domainconnect-in-dns-record-is-it-needed/185059 but no actual explanation of what it is.
I noticed this entry in one of my domains I have in CloudFlare that is registered via Google Domains, I also have another domain purchased there with a DNS zone on CF that does not have it. I'd say it's safe to get rid of the record — Google's dashboard never complained about it and DNS itself certainly does not need it.
It is more protocol than anything, and is not used to find your server's IP.
There is an open Web standard called Domain Connect that Google adheres to. Within Domain Connect's specifications (at this link at the time of writing) there is a section called DNS Provider Discovery that gives a full explanation of the spec Google is trying to fulfill by having that CNAME record.
To summarize what the Domain Connect docs say on this spec:
Every domain name, to meet this spec, needs to provide information on what DNS provider is being used (in your case, Google). It says that that information must be available via a TXT type DNS record with the host name of _domainconnect.<your domain name here>.
However, the docs alternatively allow for a CNAME type DNS record (CNAME is used as an alias record) with host name _domainconnect.<your domain name here> to point to another domain/subdomain that contains this TXT record with the record value the spec asks for. (Google does it the CNAME way with connect.domains.google.com. as the value.)
Whichever way this spec is done, the record value of this final TXT record should be a domain that you can do an HTTP GET request to, with the full URL being in the form of https://<the TXT record value>/v2/<your domain>/settings to get a JSON response that contains information about the DNS provider.
To see this in action:
If I go to a DNS lookup tool site like https://mxtoolbox.com/txtlookup.aspx, I can put the value of the CNAME record, connect.domains.google.com, in the search bar and see the corresponding TXT record, which has a record value of "domainconnect.googleapis.com". (Note: of course, when I use this value in an HTTP GET request in the next step, I'm going to strip off the double quotes.)
I should then be able to do an HTTP GET request to https://domainconnect.googleapis.com/v2/mydomain.de/settings and get a JSON response with information on Google as a DNS provider. I can see the JSON by just entering that URL in a browser URL bar. At the time of writing, assuming mydomain.de was a valid domain with Google Domains as its DNS provider, you should get:
{
"providerId": "domains.google.com",
"providerName": "Google Domains",
"providerDisplayName": "Google Domains",
"urlSyncUX": "https://domains.google.com/domainconnect",
"urlAPI": "https://domainconnect.googleapis.com"
}
And that entire journey was so that people/software can see who your DNS provider is, and some basic info about them, all via DNS. Phew...
Be advised that Google isn't the only big DNS provider that adheres to Domain Connect specs.
I followed Quickstart: Add a custom domain name to Azure Active Directory to verify my custom domain but still experiencing difficulties. I owe a domain (something like www.example.com with the only difference is mine is not 'example') purchased at GoDaddy.com.
If I try to verify that domain and specify its name (in AAD portal) as www.example.com then I can successfully complete the verification, but if I use the name example.com (without www) - I am seeing an error saying
Unable to verify domain name. Ensure you have added the record above
at the registrar 'MyDomainNameIsHere.COM', and try again in a little
while.
I employed nslookup to make sure the TXT record was added, I also followed the section Troubleshooting, non of those 3 cases apply to me:
waited for few hours
made sure with nslookup that the dns record is
correct and exists
there is no existing domain with that name
Why does it work if I prefix it with www and doesn't without it? Do I need to make some changes at GoDaddy?
I need that custom verified domain to add AAD users associated with their emails at my domain, for instance, User1#example.com; User2#example.com and so on. That doesn't work when I verify the www option complaining that example.com is not verified domain but doesn't complain if I try to create a user User1#www.example.com and I cannot do that because there is no corresponding email address.
I have an Azure Websites URL at http://mysite.azurewebsites.net. Attempting to browse to http://www.[mysite].azurewebsites.net/ results in a DNS lookup failure, with the error code in Chrome of "ERR_NAME_NOT_RESOLVED"
I've attempted to add www.[mysite].azurewebsites.net in "Manage custom domains", but receive the message "The host name www.[mysite].azurewebsites.net is invalid."
Note that I don't have a custom domain and I'm happy to use the .azurewebsites.net URL, I simply would like the users who add "www." to the URL they've been given to resolve to the correct URL.
Is this possible with Azure Websites without requiring a custom domain?
The menu from your screenshot can be used to configure any domain, you own, to point to your azurewebsite, this is not what you want.
Your "website" is a subdomain (level 3) of domain azurewebsites.net, where "azurewebsites" is a level 2 domain and "net" is the TLD. "www" is a subdoamin and normally used as (level 3) subdomain in ealier days to point out, that you are using the World Wide Web. This is not necessary and it does not make sense to create a level 4 subdomain "www". I don't even think, level 4 subdomains are supported by azure anyway.
I have created a new account on WHM and given it my domain name as the name. I then got the 2 name servers used by every site on my WHM server and inserted them into the Nameserver fields on the my registrars site. Is that all I have to do?
I know it sometimes takes a while for the domain name to perpetrate but when I type in the url it says it still parked. Is this ok?
Actually it seems what I've done is correct. The domain name did propagate eventually
A domain name that we have is using google mail as its backend, but its not hosted anywhere (no website). How can I, through the registrar interface (I'm using 1&1), redirect ppl who type in http://mail.example.com to http://mail.google.com/a/example.com ?
I can create a subdomain and set its DNS/CNAME, but what do I put where? Also, if I make this change will it affect the existing mail delivery (for which everything is running fine presently).
It turns out it wasn't that tough... and the instructions are part of Google itself:
Dashboard -> Service settings: Email -> General:Web address -> Change URL
https://www.google.com/a/cpanel/example.com/CustomUrl?s=mail
Changing CNAME record
To use the custom URL mail.example.com, you must change the CNAME record with your domain host.
Sign in to oneandone.
Navigate to your DNS Management page. The location and name
of this page will vary by host, but
can generally be found in Domain
Management or Advanced Settings.
Find the CNAME settings and enter the following as the CNAME value
or alias:
mail
Set the CNAME destination to the following address:
ghs.googlehosted.com
Save changes with your domain host and click "I've completed
these steps" below.
You cannot redirect to a path (such as /a/example.com) using only DNS. DNS CNAME records can make mail.example.com/foo effectively point to mail.google.com/foo, but something more sophisticated will require HTTP redirects. This means you need someone hosting your web page for this to work.
Sorry.
If your registrar offers an "HTTP Redirect" option, you can use that. Some registrars do. If you use this, they're effectively running a minimal web server for you. Note that this may break SSL when users access your page via https://example.com.
Mail delivery is via MX records, which won't be affected by changes to other types of record (so long as you don't interfere with the DNS records for the domain's mail servers).