# TCP/IP settings



## ericmurphy (Sep 23, 2004)

This should be an easy one: is there a terminal command you can send that will return the current TCP/IP settings (e.g., IP address, gateway, subnet mask, DNS server addresses?). Windows uses "ipconfig"; I'm assuming there's a Unix equivalent under OS X.


----------



## Viro (Sep 24, 2004)

ifconfig


----------



## ericmurphy (Sep 24, 2004)

Viro said:
			
		

> ifconfig



What are the parms? If I type in "ipconfig", I just get a complaint that I haven't added any arguments. What arguments would I use to return IP address, gateway, mask, and DNS servers?

Thanks


----------



## ericmurphy (Sep 24, 2004)

Viro said:
			
		

> ifconfig



Oops. I thought you said "ipconfig." Nevermind.

But ifconfig doesn't return DNS settings, which in this situation is actually what I was after.


----------



## nixgeek (Sep 24, 2004)

I believe you can get all the interfaces if you do an "ifconfig -a".

As for the DNS, if you are set for DHCP you might want to try and view the "resolv.conf" file in /etc.  We have our machines with everything (IP, gateway, DNS) accessed through DHCP, and the DNS entries are shown in that file.  I also believe that the DNS settings wil show in the Network Control Panel under System Preferences if you want to avoid the shell.


----------



## ericmurphy (Sep 24, 2004)

My machines are set up with static IP address. I tried 'ifconfig -a', but didn't find any info regarding where DNS is coming from. DNS entries will definitely show up in the Network Preference panel, but I specifically wanted to get them from the command line.


----------



## nixgeek (Sep 25, 2004)

Well, I never actually said that the DNS entries would show from ifconfig.  I just stated that ifconfig -a will show you all your interfaces and their IP addresses as well as subnet mask and other information.

For the DNS entries, they're in the file I mentioned called "resolv.conf" which is usually located in /etc.  Open up Terminal and do a "cd /etc" and you should see it after you do an "ls".  open that file up in vi or pico and you'll see the entries


----------



## chevy (Sep 25, 2004)

usage: ifconfig [-L] interface address_family [address [dest_address]]
                [parameters]
       ifconfig interface create
       ifconfig -a [-L] [-d] [-m] [-u] [address_family]
       ifconfig -l [-d] [-u] [address_family]
       ifconfig [-L] [-d] [-m] [-u]


----------

