linuxserverdnscentosforwarding

CENTOS LINUX cannot access example.com without hostname or www


I've configure a DNS Server on ROCKY linux. But It does not work like what I wanted. I can ping to hostname.example.com and www.example.com. But what I want is, I want to ping to example.com without hostname and www.

Can you guy help me pls !!!

Here is my configuration

I've edit /etc/named.conf zone "example.com" IN { type master';' file "example.com"; allow-update {none;}; };

And I did create and edit file example.com in /var/named/ @ IN SOA example.com root ( 0 1H 1H 1H 1H ) IN NS localhost server IN A 192.168.0.254 www IN A 192.168.0.254


Solution

  • I belive you need to add

    @ IN A 192.168.0.254
    

    If this doesn't work, try '.' instead of '@'