Dig/Nslookup | Troubleshoot DNS in Linux

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys do shots from keep attacking and today I want to do a quick video showing you guys the Dare command and in us lookup command in Linux okay so in this video I want to talk about a couple of DNS utilities which are dig and nslookup now dig stands for domain information gopher and it is used for DNS lookup and you get probe DNS servers as well as troubleshoot issues associated with DNS servers and this is one of the tools a lot of systems administrators use and that's one of the reasons I wanted to do a video on this command as well as nslookup and nslookup is another command that also looks into DNS information which it can provide the IP address as well as the MX records associated to a domain name so let's get started I'm going on and show you guys how to actually install these commands as well as a few examples on how to actually use them so I'll be right back in a second okay so I'm gonna show you guys how to actually install the de command as well as nslookup some distributions of Linux come with these commands already installed but in in case it's not on your system the way you install it it's included in a DNS utility package comes with a couple of other commands as well and the way to install it and I'm currently on using arch I'm gonna show you guys on arch but the command is sudo pac-man - capital S and then it's part of the buying tool so if you type buying you uh and type it out you'll see the actual package of tools that come with buying and it's fine - tools and press ENTER I already have it installed I know I have it installed just reinstall the right fast it only took a second but that's pretty much how you install it on and the package is pretty much the same on Debian systems as well you just run sudo apps installed in buying tools that will install these two commands as well as other tools that are used for DNS troubleshooting so the first thing let me go and show you guys a version that I have installed so the way you do that is by running a simple command is dig - B and press ENTER and it will show you the actual version which we have nine point sixteen point two now let's actually look at the options of the command so let's go into the main page so let's go man dig and press ENTER and that'll bring up the main page for D again as you can see it's a DNS lookup utility here's the synopsis description dig is a flexible tool for interrogating DNS servers it performs DNS lookups and displays the answer that are returned from the name servers that are query most DNS information use did to troubleshoot DNS problems because of his flexibility ease of use and clarity of output other lookup tools tend to have less functionality functionality than dig so that's all I want to show you right there but they do have a few options down here here's a sample of the usage so you go dig and in the server name and then type that's typical so you got actually query certain records on a server as well you can look at the a record the MX record and then down here you can add some options as well - for is for looking at IP version 4 only and index 6 is IP version 6 only as well as B for address C for class F for file but yeah you can go through and look look at all these options I'm not gonna mess with that many of them I'm just to show you a few of them that I use that are great as far as troubleshooting the system so let me quit the man page right fast and actually show you the first way to actually run a dig command and the way I want to do it is dig ubuntu.com and yeah I want to go down and use Ubuntu his website our web server and just query it using DNS as you can see it pulls all the information for ubuntu.com so if we go in here we can look at the answer section this gives you the a records for all the servers that or using Ubuntu comm so I mean it's pretty much like the think of it as a cluster these are pretty much the IP addresses for you Ubuntu comm and we scroll down here is our authority section this goes through and explains that as well as additional section these are some other RP s that are associated with with the server and if we go down here it gives you some information on how long it actually took so query time and it actually logs your IP address or displays your IP address so that's my IP address my local IP address and then this is when I actually ran the command as well as the message size okay and so the next way I want to show you the dead command I mean this one is pretty simple it's just basically running that same command but let's say I want to look at a shorter version I just want to pull that eye piece you can type plus and then shorts behind it and press ENTER and it'll just pull that IP addresses and these are the a record IP addresses as you can see they match the ones up here so let's say I mean this is what most people are looking for they're looking for the main IP addresses that are associated with the domain name so as you can see they're the same one so it just pulls that information by in there also disregarding all this other information that may or may not be relevant to what you're trying to look for so that's a cool way of actually you know digging and just pulling the IP addresses or what you want to see which is just IP address if that's what you're looking for okay and another way I want to show you guys how to run it and it'll be a very similar command I'm gonna take off these shorts well actually I could have left it on but let's only look for the MX records for it and I'm not sure what it's gonna bring up a we'll see right fast and type plus okay and so that is the mail exchange record which is pretty much the record that's used for mail so if you ever need to you know look that up you can look up just the MX record for this domain here and if you know anything about registering domains you have different records that are I'll put into into the domain DNS section you can set up the MX record you know you could point it to a different IP address and you could point your domain to whatever wherever your website is being hosted so so anyway you can specify just you want to see just that MX record and I know this might go over a couple people here if you're new to Linux but I mean this is more just DNS information that we're looking at it kind of ties to OSINT so to speak where you're actually looking for looking for information online or pulling information about a webserver online okay so now let me go down and show you guys in has to look up and the first thing I want to do is pull up that man page again so let's pull up man in s look up and press ENTER and this will pull it up the name query internet name server interactively this is the synopsis so it's in s lookup then the options in the name of the server and then and then the name of the server and quick description read in this lookup is a program to query Internet domain name servers nslookup has two modes interactive and non interactive interactive mode allows the user the query name servers for information about their host and domains or to print a list of hosts in a domain another interactive mode is used to print just the name and requested information for a host or a domain and that's all I want to talk about on here let me go don't quit this and actually wearing the nslookup so you guys could see what it actually pulls okay so now nslookup and we want to run that on ubuntu dot-com again and press ENTER and this example of the information that NS lookups nslookup will pool it'll pull all our IP addresses again you know as you can see it also looks in and gets the IP version 6 addresses as well and actually I misspoke earlier this this right here is the actual server I have a DNS server set up on my network which handles a lot of the queries so it automatically knows the DNS information for ubuntu.com from when I probably went to it a while back it still stored there so I that's the server that's actually doing do you look up for you when you run a command it will go to the nearest DNS server and try to translate that domain name to an IP address and if it has the answer at a reply back that's why it's so quick because this is all on my network I'm not actually leaving out to let's say Google servers to actually pull the information because my DNS server is the default DNS server on my local area network so when I when I was speaking above when we were running the dig them and how it said a server yeah server right here this is the actual my actual server on my network just wanted to clarify that but that's pretty much how you use both of those commands I hope you guys enjoyed the video please like share and subscribe to the channel if you have any questions leave leave a comment down in the comment box below and of course keep it techie [Music]
Info
Channel: KeepItTechie
Views: 756
Rating: 5 out of 5
Keywords: dig, dig command, nslookup, nslookup command, system load, linux tutorial, tutorial, linux, unix, bash, command line, guide, programming, Beginners, Introduction, basics, linux command line, Learn, examples, shortcuts, best practice, Linux, KeepItTechie
Id: vntErvakmsM
Channel Id: undefined
Length: 11min 22sec (682 seconds)
Published: Mon May 04 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.