LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 05-14-2008, 05:42 PM   #1
mrdancemachine
LQ Newbie
 
Registered: May 2008
Posts: 9

Rep: Reputation: 0
Smile What is the the command line that will give me full DNS IP address?


Hello,

I am kinda new but learning fairly quickly in linux. I am a windows user and I am very familiar with the ipconfig /all command and it shows IP and DNS ip and such. When i use the ifconfig -a it shows the info i need but it does not show the DNS IP addresses like Windows does. So what is the command line in Linux for me to see all relevant information needed?

Thanks,

MrD
 
Old 05-14-2008, 05:49 PM   #2
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
not sure of a command off-hand but it is defined in /etc/resolv.conf (on some distros, at least -- RHEL, CentOS, Fedora, ...) and you can 'cat' it to see what nameservers are defined.

Code:
cat /etc/resolv.conf
hope this helps.
 
Old 05-14-2008, 05:58 PM   #3
mrdancemachine
LQ Newbie
 
Registered: May 2008
Posts: 9

Original Poster
Rep: Reputation: 0
Thumbs up

Hey Rayford, that is exactly what i been looking for and very helpful. Kudos to you and thanks alot.

MrD
 
Old 05-14-2008, 06:25 PM   #4
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
Good to hear.

and Welcome to LQ!
 
Old 05-14-2008, 07:19 PM   #5
pilotgi
Member
 
Registered: Apr 2002
Location: ks
Distribution: openSUSE 12.2 64 bit
Posts: 488

Rep: Reputation: 32
You can also use 'ip addr show'
 
Old 05-15-2008, 05:23 AM   #6
cincindie
Member
 
Registered: Jul 2004
Location: Zinzinnati, OH
Distribution: RH, FC 1-6, F 7-17, Debian, LinuxPPC, Knoppix, Ubuntu, Yellow Dog
Posts: 175

Rep: Reputation: 31
'ifconfig' would work as well. It is similar to ipconfig.
 
Old 05-15-2008, 07:58 AM   #7
linuxonbute
Member
 
Registered: May 2005
Location: Ardbeg on Bute
Distribution: Ubuntu 12.04 on Laptop and Desktop PC
Posts: 37

Rep: Reputation: 15
Wink

Quote:
Originally Posted by cincindie View Post
'ifconfig' would work as well. It is similar to ipconfig.
This doesn't show the DNS server ip addresses.
Nor does ip addr show
so
cat /etc/resolv.conf
is the way to go.
 
Old 05-15-2008, 09:02 AM   #8
rayfordj
Member
 
Registered: Feb 2008
Location: Texas
Distribution: Fedora, RHEL, CentOS
Posts: 475

Rep: Reputation: 73
[quote=mrdancemachine]When i use the ifconfig -a it shows the info i need but it does not show the DNS IP addresses like Windows does. [/code]

Quote:
Originally Posted by mrdancemachine
Hey Rayford, that is exactly what i been looking for and very helpful. Kudos to you and thanks alot.

MrD
he's already used ifconfig, it does not show nameservers. resolv.conf does.

Thanks.
 
Old 05-15-2008, 09:25 AM   #9
tmancill
LQ Newbie
 
Registered: Jan 2005
Distribution: Debian
Posts: 1

Rep: Reputation: 0
See the man page for hostname, specifically "hostname -f" should show you the FQDN. This should be a little more portable than looking at /etc/resolv.conf, in case you run into machines that NIS+.
 
Old 05-15-2008, 09:32 AM   #10
Omer Fadul
LQ Newbie
 
Registered: Feb 2005
Location: Khartoum, Sudan
Distribution: Redhat+Suse
Posts: 12

Rep: Reputation: 0
you can use the following two commands:
nslookup "Enter"
server "Enter"

it will show you your name server.
beside dig is also a helpful tool.
 
Old 05-15-2008, 03:35 PM   #11
linuxonbute
Member
 
Registered: May 2005
Location: Ardbeg on Bute
Distribution: Ubuntu 12.04 on Laptop and Desktop PC
Posts: 37

Rep: Reputation: 15
Quote:
Originally Posted by Omer Fadul View Post
you can use the following two commands:
nslookup "Enter"
server "Enter"

it will show you your name server.
beside dig is also a helpful tool.
There seems to be some confusion with these answers.

He wants the IP addresses of his ISP's Nameservers.

All the commands except

cat /etc/resolv.conf

relate solely to your machine NOT the ISP's name servers.

ipconfig is a windows program which does a combination of what

ifconfig and cat/etc/resolv.conf do under linux.

If ou want to see something similar try
/usr/bin/network-admin

Last edited by linuxonbute; 05-15-2008 at 03:41 PM. Reason: added information
 
Old 05-16-2008, 01:10 AM   #12
dibi58
Member
 
Registered: Sep 2007
Distribution: fedora (x86, alpha, sparc, ppc) debian (x86, x64, mips, hp-pa, ppc) suse (x64) slackware (x86, ppc)
Posts: 59

Rep: Reputation: 18
Smile full dns ip address

try traceroute to somewhere, like:

traceroute yahoo.com

you can see the complete routing out of your box

cheers
 
Old 05-16-2008, 03:23 AM   #13
satishgupta05
LQ Newbie
 
Registered: Feb 2008
Posts: 2

Rep: Reputation: 0
ifconfig -a | grep inet | grep -v 127.0.0.1 | awk '{print $2}'

Just try with it. It is giving ip address for the machine. It is working fine for me.
Here main command is "ifconfig -a" after that is just to grep the desired output.

@
Satish Kumar Gupta
Hyderabad, India
 
Old 05-16-2008, 08:05 AM   #14
linuxonbute
Member
 
Registered: May 2005
Location: Ardbeg on Bute
Distribution: Ubuntu 12.04 on Laptop and Desktop PC
Posts: 37

Rep: Reputation: 15
Quote:
Originally Posted by satishgupta05 View Post
ifconfig -a | grep inet | grep -v 127.0.0.1 | awk '{print $2}'

Just try with it. It is giving ip address for the machine. It is working fine for me.
Here main command is "ifconfig -a" after that is just to grep the desired output.

@
Satish Kumar Gupta
Hyderabad, India
Please see post 11 in this thread. He wants the IP address of the ISP's DNS Server that is their NAMESERVER

Not his own
 
Old 05-16-2008, 08:26 AM   #15
oldscratch
LQ Newbie
 
Registered: Apr 2008
Location: South Carolina
Distribution: Red Hat, Scientific Linux, CentOS, and Ubuntu
Posts: 27

Rep: Reputation: 13
/etc/resolv.conf

Note that if you are using DHCP to obtain a temporary IP address and DNS server addresses, the contents of /etc/resolv.conf can change when you renew the lease on your IP address, change networks, or log on to a VPN.

This behavior can be controlled by tweaking the DHCP config file (/etc/dhcp3/dhclient.conf on my box).

JP
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ip address using command line Ammad Linux - Networking 2 04-24-2007 06:12 PM
ps doesn't show the full command line OlRoy *BSD 2 01-29-2007 09:34 PM
How to get an IP Address from command line? Big Dog XII Linux - General 4 01-25-2007 11:54 AM
How is it done that making 2.6 kernel it doesn't display full command line? rsashok Linux - General 5 12-07-2006 01:30 PM
Command line Full Screen Acidprime Linux - Software 3 08-13-2003 02:11 AM


All times are GMT -5. The time now is 06:25 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration