Do I need to purchase a separate domain name for my mobile site?

Most modern Content Management Systems like WordPress use templates that have a built-in functionality to show a mobile version of the website to mobile users. 
This is done by checking the user agent used by the visitor. If it is for a mobile device then a mobile version of the website is served without the need of having a separate domain name.