What is the difference between Public DNS and public IP in AWS ec2?

Solution 1:

DNS and IP are two different ways to address hosts. When you address a host using the DNS address it looks up the IP address of that address in a name server and contacts that. One simple way to illustrate this is to notice that ping some-dns-address will print the IP address in parentheses after the DNS name, and the dig command can give you more detail about how the DNS name is configured

(The details are enormously more complicated than this, and describing it in much detail in this space would be futile.)