Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Lu Brian <lyt0112@gmail.com>
To: Jan Engelhardt <jengelh@medozas.de>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: How can I get rules with all resolved IPs for FQDN?
Date: Fri, 22 Apr 2011 15:19:13 +0800	[thread overview]
Message-ID: <BANLkTimY9isyFhAH_ESgfzxo8MWV4HDcoQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.01.1104211240100.5504@obet.zrqbmnf.qr>

Hi Jan
My prolem is when I type the command :

[root@localhost ~]# iptables -t nat -A POSTROUTING -s 192.168.3.0/24
-d www.google.com -j SNAT --to-source 192.168.3.254

I can get all resolved ips for the domain name :
[root@localhost ~]# iptables -t nat -L -vn
Chain PREROUTING (policy ACCEPT 2 packets, 104 bytes)
pkts bytes target     prot opt in     out     source               destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination
3855  213K SNAT       all  --  *      *       192.168.2.0/24
0.0.0.0/0           to:192.168.1.20
   0     0 SNAT       all  --  *      *       192.168.3.0/24
72.14.203.147       to:192.168.3.254
   0     0 SNAT       all  --  *      *       192.168.3.0/24
72.14.203.99        to:192.168.3.254
   0     0 SNAT       all  --  *      *       192.168.3.0/24
72.14.203.103       to:192.168.3.254
   0     0 SNAT       all  --  *      *       192.168.3.0/24
72.14.203.104       to:192.168.3.254
   0     0 SNAT       all  --  *      *       192.168.3.0/24
72.14.203.105       to:192.168.3.254
   0     0 SNAT       all  --  *      *       192.168.3.0/24
72.14.203.106       to:192.168.3.254

when i type the command :
[root@localhost ~]# iptables -t nat -A POSTROUTING -s 192.168.3.0/24
-d www.facebook.com -j SNAT --to-source 192.168.3.254

I can only get 1 new rule for the domain www.facebook.com

[root@localhost ~]# iptables -t nat -L -vn
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target     prot opt in     out     source               destination
3855  213K SNAT       all  --  *      *       192.168.2.0/24
0.0.0.0/0           to:192.168.1.20
   0     0 SNAT       all  --  *      *       192.168.3.0/24
69.171.224.42       to:192.168.3.254

iptables command can resolve the domain name..www.google.com and
www.facebook.com can be resolved to many ips,but I can only get 1 rule
for www.facebook.com when i type an iptable command ....

2011/4/21 Jan Engelhardt <jengelh@medozas.de>:
>
> On Thursday 2011-04-21 11:04, Brian Lu wrote:
>
>> [root@localhost iptables-1.3.5]# nslookup www.facebook.com
>> Server:         168.95.1.1
>> Address:        168.95.1.1#53
>>
>> Non-authoritative answer:
>> Name:   www.facebook.com
>> Address: 66.220.146.25
>>
>> How can I get rules with all resolved IPs for this kind of FQDN?
>
> Using modern tools like iptables 1.4.10 - and host(8) FWIW.
>

  reply	other threads:[~2011-04-22  7:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-21  9:04 How can I get rules with all resolved IPs for FQDN? Brian Lu
2011-04-21 10:40 ` Jan Engelhardt
2011-04-22  7:19   ` Lu Brian [this message]
2011-04-22  9:22     ` Jan Engelhardt
2011-04-22 10:05       ` Lu Brian
2011-04-22 10:08         ` Jan Engelhardt
2011-04-22 10:35           ` Lu Brian
2011-04-22 10:52             ` Jan Engelhardt
2011-04-22 11:00 ` /dev/rob0
2011-04-22 12:31   ` Pandu Poluan
2011-04-25  1:56     ` Lu Brian
2011-04-25  2:04   ` Lu Brian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTimY9isyFhAH_ESgfzxo8MWV4HDcoQ@mail.gmail.com \
    --to=lyt0112@gmail.com \
    --cc=jengelh@medozas.de \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox