Use this tool to find preferred URL and redirection of other version of URLs.
Setting Preferred Domain & Redirection
Why this is so important?
Its very important to have one preferred URL and other versions of URL should redirect to primary URL, and this is even more important for home page.
Some people uses canonical to set preferred domain and other versions of URL loads same content. This method is also fine but looks ugly. Setting up canonical is life saver in certain situations where its difficult to redirect and good example is Magento products.
If you will not set it right then it will create duplicate content and it will create major ranking issues.