You have to do two things:
- Create A-record with name 'www' in your DNS zone, which points to your IP
- Review your website/webserver settings and add
www.mydomain.com
as host name for your site (as soon as single web server can host multiple sites - it must know which name[s] are bound to each site)
And you have to wait some time as DNS data refresh over internet - from 1 hour to 24 or even more - depending on TTL parameter in DNS. For newly added record is must be fast (as soon as there was no this record before and nothing is cached).
Also you may add A-record without name (with the same IP) to DNS and add 'mydomain.com' (without www) name to your site - it will be accessible by http://www.mydomain.com
and http://mydomain.com
addresses.