Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Remove MX from DNS zone

Discussion in 'Bind/DNS/Nameserver' started by cesarlwh, Nov 21, 2009.

  1. cesarlwh

    cesarlwh Well-Known Member

    Joined:
    Sep 23, 2008
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    56
    Hello, i need a command(to run on command line) to remove all MX entries from a specific DNS zone file.

    Somebody can help me?
     
  2. madaboutlinux

    madaboutlinux Well-Known Member

    Joined:
    Jan 24, 2005
    Messages:
    1,051
    Likes Received:
    2
    Trophy Points:
    168
    Location:
    Earth
    Copy the domain names in a file from which you want to remove the MX records say,

    the domains are
    abc.com
    xyz.com

    place these domains in a file called /var/named/removemx. Once done, execute the following command and it will remove the MX records

    for i in `cat /var/named/removemx`; do sed -i '/MX/d' $i.db; done;

    Once done, restart the named service

    service named restart
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cesarlwh

    cesarlwh Well-Known Member

    Joined:
    Sep 23, 2008
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    56
    This work!

    Very thanks!!
     
  4. cesarlwh

    cesarlwh Well-Known Member

    Joined:
    Sep 23, 2008
    Messages:
    63
    Likes Received:
    0
    Trophy Points:
    56
    how to make this using PERL language?
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice