DNS (Domain Name System) and mDNS (Multicast DNS) are both protocols used for resolving domain names to IP addresses,but they serve different purposes and operate in distinct ways.DNS is secure and scalable for internet-wide use, while mDNS is lightweight and suitable forsmall-scale networks like home or local ad-hoc setups, where simplicity and decentralization are prioritized over extensive security measures.
DNS Full form | Domain Name System
As mentioned DNS is the short form of Domain Name System.It uses DNS servers.The DNS server maps host name to the IP address similar tophone books or directory which maps name to phone number.This is done as it is easy to remember the name compare to ip address.
Prior to development of DNS, hosts file need to be managed which containsip addresses and their respective names.But over the time, due to large number of computers have been added tothe internet, it has become difficult to manage updated copy of the hosts filein all the computers. This has lead to the development of DNS across the world.
DNS works by exchanging messages between client and server machines.A client application will pass the destination hostname to the DNS process in order to obtain IP address.
As shown in the figure-1, hardware addresses are used in physical network,IP addresses are used in internet and symbolic addresses such as domain namesare used in the applications or used by users.ARP/RARP protocols convert IP address to MAC address and viceversa.DNS does translation between domain name and IP address.
DNS is a distributed database implemented in a hierarchy of name servers.The figure depicts DNS and mDNS hierarchy and syntax in tree form. As shown, the domain name is divided intoTLD (top level domain), label and host name.Each organization needs to obtain TLD (e.g. com, org, edu etc.) from central authority.Also refer DNS vs DHCP >> for understading difference between DNS and DHCP protocols.
mDNS | Multicast DNS
Like DNS, mDNS also resolves domain names to IP addresses.mDNS operate at local network level unlike conventional DNS which operates at global level.It works in conjunction with DNS-SD (service discovery) protocol in zeroconf network.Zero configuration network does not require manual operation.Moreover zeroconf network does not rely on DNS server and DHCP server for its operation.
DNS-SD allows clients to discover named list of service instances and its service type and resolvesthese various services to hostnames using standard DNS query message.The mDNS protocol is specified in RFC 6762 and DNS-SD protocol is specified in RFC 6763.There are various implementations of mDNS which include Bonjor, Avahi, Windows etc.The figure depicts tree of conventional DNS and multicast DNS (i.e. mDNS) naming structure.
Multicast DNS works at link local level and hence every node can be reached without routing.mDNS packet will not be forwarded by any router.
For link-local scope, IETF defines one single top level domain ".local.". THis is reserved for link localname used in mDNS network. It allows any device to generate its link local domain name in the formssuch as "single-dns-label.local.". For example "Mycomputer.local.".
Moreover it is also possible to use hierarchical name by users themselves such as "c.printing.local." or "d.printing.local." etc.The domain ".local." is treated the same as any other domain which mightappear in DNS search list but has only local significance. If the domain name ends with ".local.", it meansthis message should be processed by the mDNS protocol.
Let us understand mDNS with example as shown in the figure. As shown, let us assume that there are three nodes andnode-1 would like to utilize printing service offered by node-2. As mentioned all the nodes in mDNS system functions asserver or client. This is flat structure followed by mDNS protocol.
➨Let us assume that node-1 needs IP address of node-2.
➨As there is no centralized DNS server in the small network made of mDNS, node-1 does notknow from where to get IP address of node-2.
➨In this scenario, node-1 sends multicast query asking for IP address of domain name "node2.local" toall the nodes connected in this local network.
➨Consequently, both node-2 and node-3 in the local network receive the query and decide to respond or not.
➨Since node-2 has authority for this query, it generates response to answer this question of the query. Here node-2acts as server for the requested query. The response from node-2 is multicasted to the local network.
➨Node-1 receives the multicast message and will utilize it for printing service served by node-2.
➨There were two approaches for node-1 to know node-2 offers printing service or not.In the first approach, node-1 caches periodical service announcements transmitted by node-2.In the second approach, node-1 may use DNS-SD protocol to discover services offered by node-2.
Tabular difference between DNS and mDNS protocol
Following table compares DNS vs mDNS and provide differences between both of these protocols.This comparison between traditional or conventional DNS with mDNS is very useful for beginners.
Features | Conventional DNS | mDNS |
---|---|---|
Full Form | Domain Name System | Multicast Domain Name System |
Structure type and size | Hierarchical structure, max. size : 255 bytes for each domain | Flat structure, Max. size : 255 bytes |
IP address | Global IP adress | Link-Local / Global IP address |
Name server record | Yes | No |
Start of Authority Record | Yes | No |
Source / Destination UDP port | 53 | 5353 |
UDP packet size | 512 bytes | > than 512 bytes |
Number of questions in a Query message | 1 | 1 or more |
Known answer suppression | No | Yes |
Query ID field | Use | Ignore |
Question section in response message | Exist | Does not exist |
Server | Specialized DNS server is required | Each node functions as server |
Send method | Unicast | Multicast/Unicast |
Conclusion : In summary, DNS (Domain Name System) and mDNS (Multicast DNS) serve divergent purposes in the realm of network communication.DNS is a global, hierarchical system tailored for large-scale networks, offering secure and centralized domain name resolution on the internet.In contrast, mDNS is a lightweight protocol designed for local networks, utilizing multicast communication to enable decentralized and autonomous hostnameresolution among devices in smaller environments. While DNS excels in providing security and scalability for internet-wide applications,mDNS prioritizes simplicity and decentralization, making it suitable for scenarios like home networks or local ad-hoc setups where a centralized DNSinfrastructure is impractical. Refer advantages and disadvantages of mDNS protocol >>over traditional or conventional DNS protocol.
What is Difference between
SLIP vs PPP FTP vs HTTP FTP vs SMTP FTP vs TFTP hub Vs switch circuit switching Vs packet switching firewall Vs router HDLC Vs PPP IGRP Vs EIGRP
Networking related links
Basics of OSI and TCPIP layers Networking Gateway What is Router What is an IP address network switch network bridge Hub and Types of Hub What is MAC address
RF and Wireless Terminologies
SATELLITERFAntennaAvionicsWirelessLiFi vs WiFiMiFi vs WiFiBPSK vs QPSKBJT vs FETPDH vs SDHCS vs PSMS vs PS
ARTICLESTERMINOLOGIESTutorialsVENDORSIoTOnline calculatorssource codesAPP. NOTEST & M World Website