DNS server query by the registry of my domain name is fine. But browser cannot fetch my website by its address
When I query my DNS server by the website of the the registry of .com**
top-level domains, I can see that my DNS server is found:
Query
Domain: example**.com**
Answer:
Following name-servers have been defined in **NIC DNS for your domain:
1. ns.example**.com**
IP addresses defined for NS servers in **NIC DNS (glue records):
1. ns.example**.com**. *4.*41.2*.1*4
Name Server: "ns.example**.com**"
List of defined name-servers in this name server is SYNC with the list of name-servers which has been defined in **NIC name-server.
List of name-server from this server:
1. ns.example**.com**
SOA detail from this server:
localhost. root.localhost. (
2021053002 ; Serial
10800 ; Refresh
3600 ; Retry
604800 ; Expire
86400 ) ; Minimum TTL
But on any network, the web browsers are not able to show my website by its example**.com**
address.
What are my options to debug my DNS server? Thanks!
Update
I can SSH to the server and run this command:
user@localhost:~> nslookup example**.com** 8*.*41.*3.1*4
;; connection timed out; no servers could be reached
Also this commnad:
user@localhost:~> nslookup example**.com**
Server: 1.1.1.1
Address: 1.1.1.1#53
Non-authoritative answer:
*** Can't find example**.com**: No answer
Solution 1:
The server OS is openSUSE Tumbleweed 32-bit and its DNS server was already configured by YAST2. Taking a look at /etc/named.conf
indicates the named
working directory:
options {
# The directory statement defines the name server's working directory
directory "/var/lib/named";
Also /etc/named.conf
indicates the zone file relative to the working directory:
zone "example.com" in {
allow-transfer { any; };
file "master/example.comXX";
type master;
};
Before
/var/lib/named/master/example.comXX
content was:
$TTL 2d
@ IN SOA localhost. root.localhost. (
2021062000 ; serial
3h ; refresh
1h ; retry
1w ; expiry
1d ) ; minimum
example.com. IN NS ns.example.com.
example.com IN A 4.21.3.12
ns IN A 4.21.3.12
After
Modified /var/lib/named/master/example.comXX
content according to the example here:
https://ubuntu.com/server/docs/service-domain-name-service-dns
New /var/lib/named/master/example.comXX
after modification is:
$TTL 2d
@ IN SOA example.com. root.example.com. (
2021062000 ; serial
3h ; refresh
1h ; retry
1w ; expiry
1d ) ; minimum
@ IN NS ns.example.com.
@ IN A 4.21.3.12
@ IN AAAA ::1
ns IN A 4.21.3.12
Having modified the /var/lib/named/master/example.comXX
like above, now the website can be browsed by its address.