Find the answer to your Linux question:
Results 1 to 6 of 6
Hey there, I need to know what the Iptables "code" is to change the outgoing/Incoming IP for port 53 (DNS). I'm running CentOS on a dedicated server. I very familiar ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    3

    Question Changing the Outgoing DNS (port 53) IP address with Iptables?

    Hey there, I need to know what the Iptables "code" is to change the outgoing/Incoming IP for port 53 (DNS). I'm running CentOS on a dedicated server. I very familiar with Putty and SSH. So I don't need much details, I just can't figure this out. I asked my server providor but they deleted my ticket and didn't answer me.

    I tried this but am not sure if this correct of working?

    iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 53 -j SNAT --to xx.xx.xx.xx

    Any help on this would be great! Thanks.

  2. #2
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    OK, why are you trying to change the ip address of the leaving packet?

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Posts
    3
    Quote Originally Posted by Lazydog View Post
    OK, why are you trying to change the ip address of the leaving packet?
    Our names are similar


    Well I have to work around a block. See I run a these things called anonymous proxy sites and Facebook has kindly blocked my server from getting its DNS. So none of my users can access the site threw a cURL proxy script, I get "Namelookup timeout".

    I need to change to my DNS IP. I have like 30 IPs on my server.

  4. #4
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Post the output from the following command

    Code:
    dig facebook.com

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  5. #5
    Just Joined!
    Join Date
    Mar 2009
    Posts
    3
    I never knew that Dig thing.. Interesting. Its actually not Facebook I can't connect to its login.facebook.com . cURL returns. "namelookup timeout". But doing a Dig on that it does return the DNS. I really dont get this. I think there might some fatal error in the cURL gets DNS?






    ;
    Code:
    ;
    ;; Query time: 0 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Wed Apr  1 15:39:03 2009
    ;; MSG SIZE  rcvd: 232
    
    root@server [~]# dig login.facebook.com
    
    ; <<>> DiG 9.3.4-P1 <<>> login.facebook.com
    ;; global options:  printcmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40015
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3
    
    ;; QUESTION SECTION:
    ;login.facebook.com.            IN      A
    
    ;; ANSWER SECTION:
    login.facebook.com.     30      IN      A       69.63.180.173
    
    ;; AUTHORITY SECTION:
    login.facebook.com.     718     IN      NS      glb01.ams1.tfbnw.net.
    login.facebook.com.     718     IN      NS      glb01.ash1.tfbnw.net.
    login.facebook.com.     718     IN      NS      glb01.sf2p.tfbnw.net.
    
    ;; ADDITIONAL SECTION:
    glb01.ams1.tfbnw.net.   5759    IN      A       69.63.191.219
    glb01.ash1.tfbnw.net.   5759    IN      A       69.63.185.11
    glb01.sf2p.tfbnw.net.   5759    IN      A       69.63.176.101
    
    ;; Query time: 38 msec
    ;; SERVER: 127.0.0.1#53(127.0.0.1)
    ;; WHEN: Wed Apr  1 15:39:22 2009
    ;; MSG SIZE  rcvd: 184

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Yes, this shows that DNS is working.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...