Saturday, 27 February 2021

Dig Basic Commands in Linux

The dig (Domain Information Groper) is a very useful utilities for querying DNS name servers. 

List of useful dig commands.

To check dig version

# dig -v

 

To get help page

# dig -h

 

To query a single host (domain) without any additional options

# dig gitlab.com

 

To get a short answer to your query

 # dig gitlab.com +short

 

To turn off all the results and then turn on only the answer section 

 # dig gitlab.com +noall  +answer

 

To specify a name server ( By default use /etc/resolv.conf file if no name server is specified)

  # dig gitlab.com @8.8.8.8

 

To query based on record type ( any, a , cname, txt, mx and ns record )

# dig +nocmd gitlab.com any +noall +answer

# dig +nocmd gitlab.com a +noall +answer

#dig +nocmd gitlab.com cname +noall +answer

#dig +nocmd gitlab.com txt +noall +answer

#dig +nocmd gitlab.com mx +noall +answer

#dig +nocmd gitlab.com ns +noall +answer

 

 To query reverse lookup

#dig -x 95.216.246.23 +noall +answer

 

To query a large number of domains ( i.e from a file )

#dig -f test.txt +short



 

 


Thursday, 7 January 2021

GPG error: in Ubuntu Linux

You may face the following GPG error whenever you try to update the repository using apt update or apt-get update command

 


 

It could be fix the broken GPG signature validation for apt using rebuild the trust db.

Follow the steps to rebuild the trust db,

Remove or move trustdb.gpg, trusted.gpg.d (files and folder)

# rm -rf  /etc/apt/trusted.gpg*

Then update the key using the following command

# apt-key  update

Finally try to update the repository

# apt-get update

Still if you are facing the problem, you may refer the below link

https://gist.github.com/piersharding/ffc505564a82daaf6ff33d951f568dad