removing a subdomain 'www' from a URL
-
This post is deleted! -
@ZAJDAN
http://example.cz
does not reach site?
http://www.example.cz
does not reach site?Does your PC resolve the domains?
Check in command line:nslookup www.example.cz. nslookup example.cz.
-
@DoctorG
in browser it does not reach in any case, because the www is removed.via nslookup it is resolved correctly only with www:
As I wrote, to make it works without www is only a way and it is create on our local DNS server A record (static)
info21.cz 83.167.224.3
which will send anything to the defined IP, but it is not good!We need explicitly define any subdomains, where they are, because we have multiple subdomains and each of them runs somewhere else.
When You go from outside network, where is used other DNS, you will reach the web even if you pass URL without www or with www.
But we need to reach the web when we are in local network(inside the domain) and there it is possible just when the DNS request contains www. -
@ZAJDAN The server domain redirect always to domain without the www, i guess with HSTS. You should configurate your webserver.
And you should check your routing of network.
if you want to reachinfo21.cz
internally, you need a local DNS server and do not routeinfo21.cz
to outside. -
@DoctorG
I will look on the configuration of the web server, if there is something what removes the www.
What I am sure there is configured "force HTTPS" but it has anything to do with remove subdomain.We have local DNS as I wrote and there we do not route info21.cz to outside. We route via static records subdomains only:
A www.info21.cz 83.167.224.3
and so on....I suspect that DNS request which goes from the browser is already without www and there is the problem, that our local DNS server gets request info21.cz instead of www.info21.cz
-
$ curl -I https://www.info21.cz HTTP/1.1 301 Moved Permanently Date: Tue, 02 Jan 2024 17:02:28 GMT Server: Apache/2.4.38 (Debian) X-Pingback: https://info21.cz/xmlrpc.php X-Redirect-By: WordPress Location: https://info21.cz/ Content-Type: text/html; charset=UTF-8
-
@ZAJDAN said in removing a subdomain 'www' from a URL:
A www.info21.cz 83.167.224.3
DNS record!?
This is not a network route!Check this
route print
And
traceroute info21.cz
and
traceroute www.info21.cz
-
@Pathduck
Thank You for this. It was setting in WordPress configuration. I changed it and now it is correct.
But it is not related to the problem I am solving. -
@DoctorG
Iam sorry but this I do not understand.
Routing is on Layer 3, so I have no idea how to add route for domain name. -
My suspicion was right, even if I put into address bar www.info21.cz , so from Vivaldi is sent DNS query info21.cz
Anyway when web browser does such things, it is very bad approach and really do not understand what is the idea for. If You will explain me for what it is good I will send You big chocolate :_)
-
@ZAJDAN Have you tested this in other browsers?
Do you have group policies in place on the network?
Checkchrome://policy
in Vivaldi.For me, I enter
www.info21.cz
and full url reads:
-
@Pathduck said in removing a subdomain 'www' from a URL:
chrome://policy
No policies set
And yes..You see the full URL, because Your request has been answered and solved via another DNS. Where is the domain has been obtained from authoritative DNS(domain registrar).
I am inside local network where we have DNS server and Domain Controller which provide the domain info21.cz
The website www.info21.cz runs outside at webhosting.
For the www.info21.cz I created in our DNS static A record, but DNS gets request for info21.cz instead of www.info21.cz because browser remove the www, so the DNS server does not know where the site is. -
@ZAJDAN Once again - have you tested this in other browsers?
-
@Pathduck
Chrome - same problem
Firefox - my colleague tested it in and it works. Tomorrow I will ask him which version he has.But either way, any browser should not do that!
-
@ZAJDAN Had you tried to flush your PCs DNS cache?
Is Use of secure DNS active in chrome://settings/security?
What does
nslookup info21.cz
give you?
What doesnslookup www.info21.cz
give you?Check chrome://net-internals/#dns and query domain info21.cz and www.info21.cz. Gives you what?
Does in internal page
chrome://flags/#enable-async-dns
set to Disable and Restart help?Perhaps a exception could help
https://datacadamia.com/web/browser/chrome#dns_resolver -
Check chrome://net-internals/#dns and query domain
chrome://flags/#enable-async-dns
even if is Disabled / Reloaded ...does not helps.As I wrote, the problem is that the web browser removes www and into our local DNS server goes from client request info21.cz
For info21.cz we have not PTR (static A record) only for www.info21.cz, so from logic DNS does not know where to point.
To make PRT for info21.cz is not god, because in some cases DNS has tendency point there any request about domain info21.cz
I need explicitely define where is each subdomain. -
@ZAJDAN Secure DNS is off?
-
I tested with a subdomain www and added to /etc/hosts entry www.example.org to resolve to 192.168.0.100, and Vivaldi did not redirect to example.org. example.org will be visited in WWW and www.example.org in webserver of LAN.
-
@DoctorG
Secure DNS - do You mean some settings in Chrome?
If yes, where I can find it please?Linux:
/etc/hosts
Windows:
C:\Windows\System32\drivers\etc\hostsWhen client asks some domain, system firstly look into this file and when is not found there, then asks DNS server.
But I do not want to add such record on each client manually.
Only what I can think about is create some domain rule to add for each client automatically.But anyway I stay for my opinion. Web browser should at least be able to disable such behavior 'remove subdomain www' .
-
@ZAJDAN In Vivaldi at chrome://settings/security