[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Redirect to domain name instead of ip



Kenny skrev:
> iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2211 -j DNAT --to 172.16.0.30:2211
> iptables -A FORWARD -i eth0 -p tcp --dport 2211 -d 172.16.0.30 -j ACCEPT

Thank you for the reply, the lines works fine. But I've still got a
dynamic problem, the ip can change with dhcp and therefore it would
be perfect if i could use a domain name. DDns (bind9) is working
along with  dhcp3-server.
The PREROUTING line is complaining if I write pc.dom.dk instead of
172.16.0.30, is there a way to bypass this problem?

And another problem i just though of, if the iptables-script is
executed at a time where pc.dom.dk hasn't got a dhcp-release yet,
there will be no answer in the dns-lookup. So any experience on what
behavior iptables have when there is not ip resolved from the domain
name. Is the rule just set or will the rule return an error.

Best Regards

/Lars



Reply to: