I have set up a DNS service on a Debian 11 server (BIND 9.16.33-Debian) for my company's LAN with the following (forward) zone file (mycomp.com
isn't the real name, of course):
# cat forward.mycomp.com.db
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.mycomp.com. root.ns1.mycomp.com. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
;@ IN NS localhost.
;@ IN A 127.0.0.1
;@ IN AAAA ::1
@ IN NS ns1.mycomp.com.
ns1 IN A 192.168.50.9
www IN A 77.66.11.123
bonsai IN A 192.168.50.149
...
All PCs point to the internal DNS:
# cat /etc/resolv.conf
# Generated by NetworkManager
search mycom.com
nameserver 192.168.50.9
The problem now is, that the company website is also called mycomp.com
- I tried to include www
in forward.mycomp.com.db
, and it works, in the sense that it resolves to the right address, but www.mycomp.com
is only an alias for mycomp.com
, so I still can't reach the website from inside the LAN. I can see from my searches that I am sort of on the right track, but I think I need to point my browser to mycomp.com
. However, including mycomp.com
in the file above doesn't work, obviously; how do I fix this?