Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

On Ubuntu, how do I get a list of network connections my computer has made in the last few days? Is there a easy way to do this?

share|improve this question
    
for future cases, you can set up your system as described in there. –  sazary Jan 30 '13 at 20:59

1 Answer 1

up vote 6 down vote accepted

You can't get ended connections unless you were logging them. To get the current connections:

# sudo netstat -tupn

This will show the current opened source and destination ports with IPs.

To get more details about the contents of the connections, install tcpdump if it's not installed and run:

# sudo tcpdump -X -i eth0 

And you can run that in the background and write the output to a file.

share|improve this answer
    
Thanks @islam. Is there is a good way to automatically convert the ip address in netstat to their corresponding dns entries? –  Saqib Ali Jan 30 '13 at 22:31
1  
In the netstat remove the argument 'n' which means don't resolve IPs to hostnames. –  Islam Jan 31 '13 at 8:00
    
I would recommend adding the -a (all) flag as well. –  cupojavashort Jan 31 '13 at 10:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.