I inserted the CentOS 6 dvd in my machine, mounted it with following command
mount /dev/cdrom /DVD
Then this command to create repo file
vi /etc/yum.repos.d/DVD.repo
And inserted these lines in that file:
[DVD]
name=DVD Packages
baseurl=file:///DVD
gpgcheck=0
Can anyone tell me where did I go wrong?