Domain names are used to identify one or more IP addresses. For example, the domain name microsoft.com represents about a dozen IP addresses. Domain names are used in URLs to identify particular Web pages. For example in the URL http://www.pcwebopedia.com/index.html, the domain name is pcwebopedia.com.
Hostnames are used to identify computers on a network. For example, the hostname of this computer is web media and its fully qualified domain name is webopedia.pcwebopedia.com (If you're curious the term "fully qualified" means that the domain name includes all of the information necessary to find it on the Internet.) Most people don't use hostnames except when they are troubleshooting network problems or writing code that needs to connect to specific computers on a network (for example when you're setting up an email program).
Domain names are used to identify one or more IP addresses. For example the domain name "www.example.com" could represent the IP addresses "192.0.2.1" "192.0.2.2" and "2001:db8::1". Hostnames are used to identify computers connected to networks such as the Internet. For example, the hostname "example" might represent the computer with IP address "192.0.2.1".
A domain name may be composed of several levels of domains such as .com .co .uk and so on. which are called top-level domains (TLDs). Domains can also be subdomains of other domains; for example "subdomain.example.com" is a subdomain of the domain "example.com" A subdomain can be a second-level domain (SLD) such as .co in co.UK or a
Domain names are registered with a registrar while hosting is provided by a web host. A domain name is the address of your website on the internet while hosting is the space where your website's files are stored. You need both a domain and hosting to create a website. You can register a domain name and set up hosting with the same company or you can register your domain with one company and set up hosting with another.