Every website used to be like “www.example.com”. Now I rarely encounter this “www.”. Why did it even exist and where has it gone? I also used to run into websites with legitimate domains, but “ww1.” instead of “www.”, these were probably phishing sites, but how did this actually work on top of legitimate domains?


The A record is the record in a DNS entry that contains the IPv4 address to which you wish to map the name in general.
There are various others, for example the AAAA record is the one that contains the IPv6 address, the MX record is the one that contains the name of your mail server, the NS record contains the name of your nameserver, the SOA record has refresh timers and contact information for the zone admin, RRSIG records have cryptographic signatures proving authenticity of various other bits.
Another interesting one in this context would be CNAME, there you can put the canonical name you’d like the user to look up instead of the one they were asking for. So you can leave out the A and AAAA, and put in a CNAME instead if you want to tell the user to look somewhere else.
For example you can put in the DNS entry for www.example.com a CNAME record containing “example.com”. Now if a user comes asking for the A record of www.example.com, they will find the CNAME instead and know that they are supposed to look at the A record of example.com instead, because there isn’t a separate IPv4 address specifically for www.example.com.