Edit named.conf via SSH

Posted on 2006-04-11
Last Modified: 2008-03-03
Hi bros,
How do I edit /etc/named.conf via SSH?
I would like to delete this line:

allow-recursion {localnets; };

and add this line:

recursion no;

to prevent DNS recursion lookup

Question by:njmoneer
    LVL 14

    Accepted Solution

    if you can logging in the remote computer you can do that

    cd /etc
    vi named.conf
    change the line
    and that all
    LVL 3

    Assisted Solution

    Yo bro,

    If you are using RedHat/Fedora/Centos/Mandrake/SuSE,most of the famous distro. SSH server is running by default.
    SSH server uses port 22.

    From Windows Client to access Linux Server (via ssh).
    My favourite, and it's free.

    From Linux to Linux Server (via ssh), just type
    # ssh

    Make sure your firewall opens port 22, and it's forward to the linux box.
    Good luck.
    LVL 43

    Assisted Solution

    If You don't want to login but edit if from ssh's command parameter, use -t flag
    ssh -t 'vi /etc/named.conf' # replace vi with Your favorite editor
    LVL 27

    Assisted Solution

    ssh to remote host, as kiiti said.
    use 'nano' instead of 'vi' for editing file, it's easier for novice:

    nano /etc/named.conf

    then append:

    options {
         recursion no;                      // Do not provide recursive service

    Then ^X Yes to exit and save changes.
    LVL 1

    Assisted Solution

    Dont forget the rndc reload once you have made your changes

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now