LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 10-23-2003, 10:24 PM   #1
costasm
Member
 
Registered: Dec 2002
Posts: 71

Rep: Reputation: 15
ifconfig shortcomings


I searched and could not find an answer for this.

"ifconfig" on Linux does not show the following information:

-DNS servers
-Default Gateway/DHCP servers

However "ipconfig /all" in Windows shows all that.

Is there an option or command to find the missing info?

Thanks
 
Old 10-23-2003, 11:16 PM   #2
beolach
LQ Newbie
 
Registered: Jul 2003
Distribution: Gentoo
Posts: 29

Rep: Reputation: 15
You can find the default Gateway with

/sbin/route

or

/sbin/route -n

It will output your routing table, including your default gateway, as below:
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
Default         <hostname>      0.0.0.0         UG    0      0      0   eth1
or (/sbin/route -n)
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         <hostip>        0.0.0.0         UG    0      0      0   eth1
The DNS servers are listed in the /etc/resolv.conf file. Find what they are by running:

cat /etc/resolv.conf
Code:
nameserver <nameserver1-IP>
nameserver <nameserver2-IP>
search <domain-suffix>
How to find the DHCP server you got your IP from depends on what DHCP client you are using, and how it is set up to store info. On my box, I use dhcpcd which saves info in /etc/dhcpc/dhcpcd-ethN.info. In that file it has a line like:

DHCPSID=<DHCP-server-IP>

Much more info available:
man 8 ifconfig
man 8 route
man 5 resolv.conf
The DHCP-mini-HOWTO


Hope this helps,
Beolach
 
Old 10-24-2003, 08:02 AM   #3
costasm
Member
 
Registered: Dec 2002
Posts: 71

Original Poster
Rep: Reputation: 15
Thanks. It would have been nice if it was all in one place I guess.
 
  


Reply



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
connecting /sbin/ifconfig to bash command ifconfig flammable2 Fedora 4 11-12-2005 07:58 AM
Ifconfig Eugney Slackware 6 07-07-2005 02:08 PM
Ifconfig mrodriguez Linux - Newbie 2 02-16-2005 12:17 PM
ifconfig help riffe Linux - Networking 2 07-31-2004 09:33 AM
Ifconfig ! mesta Linux - Software 2 02-04-2003 09:18 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration