Modifiy DNS packet source IP

Discussion in 'Server Operation' started by raws99, Jan 26, 2014.

  1. raws99

    raws99 New Member

    Hello! Finally I signed up, since the howtos here helped me alot!

    I want to "edit" the source ip of my outgoing dns traffic(packets):
    Client (IP: -> My DNS Server ( -> External DNS Server (

    DNS Packet (source ip -> My Server (magic happens) -> External DNS (source ip

    So the client requests a domain from my dns server, here I want to forward the request to an external server, which checks the source ip of the request to give access.

    So I need to manipulate the DNS Packet to have the DNS Servers IP ( as Source IP...

    I found the following:

    I have bind running, which will forward the requests to the other dns server, now I only need to edit the outgoing traffic on udp/tcp 53 to have the source ip of the server, right?

    How can i realize this with iptables?

    Thank in advance!
  2. raws99

    raws99 New Member


    Just a quick answer: It's not possible on my virtual server (using openvz)

    So I thought I'm unable to follow some instructions, in fact it's not supported.. :)

    So the above howto is a good one for anyone having the same question!


Share This Page