Add dns name support to ec2

Hello!

About 5 days ago I submitted the pull request (#5663) that add support dns name to ec2 module. Can anyone look at the code and make review. Is it good idea or not?