Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

With UFW, I disabled all outgoing and ingoing traffic by default. However, I do allow port 80 in and out:

  1. sudo ufw default deny incoming (deny all incoming)
  2. sudo ufw default deny outgoing (deny all outgoing)
  3. sudo ufw allow in 80/tcp (accept all incoming tcp from port 80)
  4. sudo ufw allow out 80/tcp (accept all outgoing tcp to port 80)

Yet, the following commands don't seem to work. Could anyone tell me why?

mainuser@saturn101:~/apps/mongodb$ curl > mongodb-2.0.4-rc1.tgz

curl: (6) Couldn't resolve host ''


ping: unknown host


sudo apt-get update
share|improve this question
up vote 3 down vote accepted

You didn't enable DNS traffic (TCP/UDP outgoing, port 53) and UDP 1024-65535 outgoing (also required for DNS.

share|improve this answer
Excellent, apt-get update seems to be working without UDP 1024-65535 outgoing though. When is this really necessary? – Tom Mar 17 '12 at 16:21
FYI, I have posted a follow up question – Tom Mar 17 '12 at 17:48
Outgoing to port 53 UDP and TCP is sufficient for DNS. Restricting the source to 1024-65535 for this rule is optional. – BillThor Mar 18 '12 at 0:43

The correct syntax would be

sudo ufw allow out to any port 53

This resolves problem with DNS

share|improve this answer

Your Answer


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.