Im a noob at iptables, and have recently setup a new server ans used webmin to tell iptables to allow incomming port 80, 443, and 22. However with iptables enabled the server can no longer ping external servers or do dns lookups.
What do I need to change in iptables to allow such things?
The rules are going to change depending on whether you have a firewall which all traffic passes through, or the firewall is on the actual machine you want to protect. I've written the rules assuming the latter.
But if you have a dedicated firewall box which protects other servers, you'd probably want
Instead of INPUT our OUTPUT.
The easiest thing to do would be to allow all outbound traffic for that server. Or you could be more specific, its up to you.
# Allow outbound traffic from MyServer
iptables -A OUTPUT -j ACCEPT -s $myServer
Where $myServer is whatever IP you have. Not sure about how you'd do this in webmin, sorry.
Whether you want to allow all outbound traffic, or be more specific, is up to you.
You may also find it useful to allow inbound ICMP (for pings), if you haven't already.
iptables -A INPUT -j ACCEPT -p ICMP -d $myServer
I never use Webmin to configure iptables, but check if you can add a rule:
Allow incoming traffic related/reply to outgoing traffic.
Allow established incoming traffic.
If there's no such rule, you have to add two rules:
Allow incoming UDP from port 53
Allow incoming ICMP
Ok, I figured it out.
I deleted all the rules I have and reset the firewall with a bunch of preset defaults the webmin module provided.