Modern web browsers may use DNS-over-SSL or DNS-over-HTTPS services and bypass the regular DNS services configured in the operating system, as those are claimed to be more secure than regular DNS. In your case, this might be producing the expected, correct URL resolution.
If you have the
unscd package installed in Ubuntu, it is a Name Server Cache Daemon - in that case, you might want to run
sudo nscd -i hosts to flush its cache.
DNS diagnostics tools like
bind usually bypass the
nscd cache and talk directly to the nameservers configured in
/etc/resolv.conf. However, if your system is using
systemd-resolved (as indicated by having
nameserver 127.0.0.53 in
resolvectl status displaying the actual DNS settings instead of an error message) they might still be affected by the local cache. But
resolvectl flush-caches should have already dealt with that cache.
As mentioned in the comments by QuartzCristal,
dig @188.8.131.52 xsubdomain.xdomain.com tells the
dig command to directly contact Google's 184.108.40.206 public DNS service, skipping any DNS services configured to the operating system. If that results in the correct IP address being displayed, then the problem is either within your local system or in the nameservers configured for it; if that also results in the wrong IP address, then something (possibly some malware) might be manipulating any unencrypted DNS traffic between you and the internet.
nameserver lines in your
/etc/resolv.conf and/or the DNS server settings in
resolvectl status output point to your router, it might be a good idea to reset your router: turn it off for 30 seconds or so, then turn it back on. You might want to see if there are security updates available for your router: there are some pieces of malware in the wild that attack routers with known vulnerabilities, and some versions of them might try redirecting the users' traffic, possibly for snooping or for injecting extra advertising. Your router might have been vulnerable to one of those.
As far as I know, most such malware infections in routers can be cleared by resetting the router, but if the vulnerable firmware version is still present in the router, it might get re-infected pretty quickly.
resolvectl status or
/etc/resolv.conf file points to your Internet Service Provider's DNS servers, or if they point to your router and resetting the router and getting its firmware up to date did not help, then it's possible your ISP's DNS servers have a problem of some sort. In that case, you probably should contact your ISP and report the problem. While waiting for your ISP to fix things at their end, you might want to configure your Ubuntu and/or your router to use Google's 220.127.116.11 or other public DNS service instead of your ISP's nameservers, as a workaround.