The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

utility to update "A" entry to CNAME in bulk for some selected domain

Discussion in 'General Discussion' started by crazyaboutlinux, Oct 14, 2011.

  1. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    utility to update/change/replace "A" entry to CNAME in bulk for some selected domains in Edit DNS Zone

    mail 14400 IN A 61.17.xx.xxx (i want to update/change/replace it to as below)
    mail 14400 IN CNAME my.server.com

    and i want to do this for some selected domains which are currently hosted on the server
     
    #1 crazyaboutlinux, Oct 14, 2011
    Last edited: Oct 14, 2011
  2. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    any update on this ??
     
  3. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    You can use something like awk & sed to find and replace.
     
  4. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    if possible can you mentioned in detail ??
     
  5. ModServ

    ModServ Well-Known Member

    Joined:
    Oct 17, 2006
    Messages:
    332
    Likes Received:
    5
    Trophy Points:
    18
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    Let's say I've a DNS Zone file like this:
    PHP:
    root@dehost1 [~]# cat zone.com.db

    I want "for example to delete the line 41 highlighted in RED"

    Just execute this command:

    PHP:
    sed -'41 d' zone.com.db
    You will see no result after executing, Ok, Let's view the file after this:

    PHP:
    root@dehost1 [~]# cat zone.com.db
    LINE DOES NOT EXIST!, That's great, Let's continue..You can add the requested line as below:

    PHP:
    echo "mail 14400 IN CNAME my.server.com" >> zone.com.db
    Ok, Let's try in action:
    Done ;)
     
Loading...

Share This Page