
Before discussing what is DNS spoofing, let me first explain what is DNS and what is the importance of it.
DNS (Domain Name Service ) is a service which provide the facility of giving u IP addresses of named domain. Let me explain it in more detail by taking an example.
whenever we type an url or website name in the browser,browser doesn't know what is this url or what is this website name. It only understand IP addresses. It can only send request or get responses from a IP address. So, what does browser do in order to resolve a name into IP address.It sends a request to the nearest (DNS) server to resolve this name into IP address. Now its the job of DNS server to find out the correct IP address of a particular domain name and return it back to browser.
for eg. You're on your web browser and wish to search something on www.google.com, without to think of it, you just enter this URL in your address bar and press enter.
Now, what's happening behind the scenes ? Well... basically, your browser is going to
send a request to a DNS Server to get the matching IP address for www.google.com, then
the DNS server tells your browser the IP address of GOOGLE, so your browser to connect
to CNN's IP address and display the content of the main page.
Here comes the concept of DNS Spoofing.
What if after entering the url, u get a page containing a message like 'yahoo is more efficient than google'.
you must be amazed that why google is saying that yahoo is better despite the fact that they are in the same business. Then to confirm yourself you type the IP address of google instead of typing the name (you can get the IP of a domain name by simply pinging that domain).
As soon as you type the IP address and press enter, you see the original google website,you can be sure that your DNS server which duty was to resolve the name into IP has been spoofed.
in the above picture, first the DNS server has been comprised by an attacker and he has replaced the entry of bank.com with another IP address. So, whenever a user will type bank.com into his browser, browser will take him to the fake website.