In this article, you will find what is DNS and how it works. You will also learn about host files. how to use the net, command Windows Naming Resolution, Dynamic DNS and some troubleshooting of DNS.
Smartphones have made our life a lot easier. If I want to talk to anyone I just simply dial their number and call them. Nowadays you don’t even have to dial a number just open up the name of the person from the contact list and dial your phone will automatically call that person to whom you want to talk. The contact list is so important nowadays that if you lost that you will not able to contact anyone.
We have the same case in the computer world. Let’s say we have to computers one is a web server and the other one is a web browser who wants to talk to the webserver. The only thing associated with the webserver is an IP address. One thing that can happen is a simple type IP address in the URL and the webserver will respond.
But you know it’s difficult to remember IP address every time. So we come up with a contact list system. So this contact list is called DNS ( Domain Name System ). So the purpose of DNS is to resolve the IP address based on the fully qualified domain name (FQDN).
In simple words it’s purpose is to find the IP address of a domain name eg www.google.com. One more thing you need to understand is TLD and hostname. In www.google.com the last part .com is TLD its other examples would be .org, .gov .net, etc and the starting part www is the hostname. It can be anything but we use www because people are used to typing www.
For FTP it would be ftp.google.com because people will expect FTP for FTP servers. For the Mail server, it would be Mail.google.com.
Now google in the middle is called secondary domain name now it can by more than google eg images.google.com Now in this images.google is our secondary domain name.
Now the question is how the IP is given to the client well it includes a process. And all of it is base on DNS servers which reply back with the required information.
First the client as his own local DNS server to give an IP of a domain if that local DNS server has that it will reply back with that IP else it will ask ISP to find it. Now ISP has its own DNS cache server where they have cached all IP based on usage.
Now if still there is no required IP request will go to Root DNS server and root DNS will see it’s a .com domain it will say go to .com TLD DNS Server where we have all the information stored related to a certain TLD eg .com or .org or .net etc.
Now TLD will reply back here is the place you can get the IP now request will go to Auth Name Server and get the IP. Now we can talk to our required server and we will save that IP in our local DNS Server.
You can also use an interior DNS server for your own private network. Now if you are setting up a DNS server you have to add Records eg A record, CNAME, AAAA Records, etc. All of these have a certain meaning and tell DNS servers about some information eg A record tells the IP address. You can see the image below to know for what purpose they are used.
All of these records have their own purpose and have a certain meaning to the DNS server. If someone wants to send mail he will use the MX record for starting the process. But for avoiding the Mail Spoofing we need Reverse Lookup Zone which simply verifies the Domain Name by providing the IP address. It’s inverse of a regular lookup zone.
There are a lot of records which can not be covered here you can simply check them all over the internet. For summing up, CNAME record creation makes an alias name or “known name” often created for user interfacing.
A reserve lookup zone will resolve an IP address to an FQDN and are used by mail servers.
TXT records, DKM1 and SPF are used to identify email users and reduce spam.
At the start, internet doesn’t have DNS because there were a few thousand computers on the internet. So instead of DNS, there was a thing called host file. It was nothing but a bunch of names and lists of their IP address.DNS totally overtook host files but they still exist.
So every computer that runs TCP/IP has a host file either it’s windows or Linux or Mac. The important thing is HOST file takes precedence over the DNS. You can find it on windows in C–>Windows–>System32–>Drivers–>etc you can test the precedence by going to the host file and type the IP address of your favorite website eg yahoo.com and after a space type google.com now reboot your system. Now anyone who will open google.com will be goto to yahoo.com.
net command is one of the oldest commands in the networking world and if you are a network person you must have to know about it.
If you type net in cmd you will find a guide telling what you can type with that.
If you want to see the systems within your workgroup simply type net view in cmd and you will be shown a list of those systems.
If you want to find out how many users have created on the system and what privileges they have you can simply run the net user command.
Let’s say you are not a network and there are several systems sharing folders. If you want to find out which system is sharing what folders you can find this by command net view system-name.
one more thing you can do is share files and folders on your network with other computers with command net share Donte=C:link_to_file it will share that file with name Donte with all other computers. That file will shart to show in your shared folder also.
Some other important commands include net accounts which show the setting of all accounts which you have set up eg password expiry date etc. net start will show all network-based services running on your system. You can turn them off by net stop “service name”.
Windows Naming Resolution
A windows system do a name resolution in a very specific order. If its a member of the domain it will go to its domain controller which is the DNS server and everything is done through DNS.
If you are not in a domain you are at your home you will use NetBIOS and you will be using post 137,138,139 to handle your name resolution. After vista, a new protocol came out called LLMNR ( Link-Local Multicast Name Resolution ) It runs on UDP port 53,55 and it is improved Name Resolution service than NETBIOS.
So Nows a day if you are not on a domain it depends on your windows how Name Resolution will be done. So if you are on windows 10 professional you use both NetBIOS and LLMNR.In windows home, NetBIOS is completely gone.
So because of all the options, there can be a lot of problems and there is a tool to finding the problem it’s called nbtstat the bad things is it doesn’t work with LLMNR.
nbtstat -n command will help you to find a list of PCs and tell what system can do which is connected. eg part of a group or can share files etc and nbtstat -c is used to see the cashed systems.
ntbstat job is to help you find there is a problem. You have to find and fix the problem yourself.
Let’s say you want to access a Camera so you have to know the IP of that device. So the problem is you obtain that IP address via DHCP which changes from time to time. So to get around this we use dynamic DNS.
So there are online companies who give Dynamic DNS and they add a domain name to our IP.eg TZO.com they will give you a domain and you will add to your IP. and access your camera using that domain name. You will download their client to start working. It will know you IP address one thing you will have to do is port forwarding on a port that will go to that IP.
First thing you should do while troubleshooting is typing the IP instead of the domain name. A lot of times when there is a DNS problem your domain doesn’t work and you have to type the only IP for verifying this. To solve make sure your DNS is set to fetch automatically.
Sometimes your copies of the website are cached so try to run ipconfig/flushdns to clear the DNS resolver cache a lot of time this helps to solve the issue.
Always run nslookup or dig to check the status of a DNS server if its in good condition.