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.

How to disable recursion in /etc/named.conf

Discussion in 'General Discussion' started by zigzam, Jun 17, 2008.

  1. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    It appears the /etc/named.conf file has changed recently and I cant seem to figure out how to disable recursion now.

    Any ideas?
     
  2. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    In the /etc/named.conf file you will find a line that says:

    Code:
    options {
    If you follow that section you will eventually see a closing brace for the options section.

    Just somewhere within that section add:

    allow-recursion { xx.xx.xx.xx; yy.yy.yy.yy; zz.zz.zz.zz; };

    Where xx.xx.xx.xx, yy.yy.yy.yy, zz.zz.zz.zz are IP addresses that you want to allow recursive look ups from. I don't know your exact set up, there probably only a need for listing 127.0.0.1 in your recursive list:

    allow-recursion { 127.0.0.1; };

    but your needs may be different.
     
  3. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    My named configuration file no longer has that. All it lists are domains.
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    It should be at the very beginning at the top of the file. Have you scrolled all the way to the top of the file?
     
  5. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    I just checked on 7 servers and none of them have the options section anymore. I even ctrl +w and [ "options" not found ]
     
  6. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    What operating system are you using?

    What version of bind are you running? /usr/sbin/rndc

    Is your server managed or unmanaged? If it is managed, I would contact your datacenter or management team concerning this.
     
  7. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    I manage the servers.

    Version: 9.3.3rc2

    OS: Centos 5
     
  8. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    I just checked and its the old way on Centos 4 and Redhat 4. Must be stored somewhere else in Centos 5 and Redhat 5.
     
  9. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I just have one server that is running CentOS 5 at the moment. I checked it and it has the options part at the beginning of the named.conf file.

    I really don't know. Perhaps someone else can shed some light on this situation.
     
  10. bhd

    bhd Well-Known Member

    Joined:
    Sep 20, 2003
    Messages:
    149
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    JNB ZA
    cPanel Access Level:
    Root Administrator
    I have several CentOS 5 servers and it is definitely there. Look for include directives at the top of your named.conf file. The stuff you are looking for may not be in the named.conf file itself but in an external file.
     
  11. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    There is nothing in the file. I checked some files in the /etc directory and found named.conf.prefixrndc to have the options section and rndc.conf but neither have any affect when changed.
     
  12. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Add the missing sections to your named.conf file. See if that has any affect. I don't know about this. Who did you purchase these servers from? Did they install the OS and cPanel? You might want to ask them about this, even if it is unmanaged, because it looks like those sections should be in your named.conf file and if they are not then something is wrong somewhere.
     
  13. ChrisRHS

    ChrisRHS Well-Known Member

    Joined:
    Jul 12, 2006
    Messages:
    292
    Likes Received:
    5
    Trophy Points:
    18
    Try running :

    updatedb

    locate named.conf

    If you are chrooted, it may be at :

    /var/named/chroot/etc/named.conf
     
    #13 ChrisRHS, Jun 18, 2008
    Last edited: Jun 18, 2008
  14. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    The servers are from SoftLayer
     
  15. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    I have servers at Softlayer, but they are all running CentOS 4. It may be something in their provisioning system that removes this from the named.conf file (though I don't know why).

    Try adding an options section at the beginning of the named.conf file and see if it has any affect.

    Code:
    options {
            directory "/var/named";
            dump-file "/var/named/data/cache_dump.db";
            statistics-file "/var/named/data/named_stats.txt";
            allow-recursion { 127.0.0.1; };
    };
    That is what is in my named.conf file.

    Then restart named /scripts/restartsrv_named
     
  16. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
    That fixed the issue. SoftLayer must have an issue with their setup system.
     
  17. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,382
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You might open a ticket with Softlayer concerning this. Or see if there are any others with a CentOS 5 at Softlayer and see if they are also having this problem. You might post on the Softlayer forums about this.
     
  18. zigzam

    zigzam Well-Known Member

    Joined:
    May 9, 2005
    Messages:
    206
    Likes Received:
    0
    Trophy Points:
    16
  19. catmag

    catmag Registered

    Joined:
    Jun 9, 2008
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Here's a snip from /etc/named.conf on Centos 5 running bind 9.3.4

    Code:
    view    "external" {
    /* This view will contain zones you want to serve only to "external" clients
     * that have addresses that are not on your directly attached LAN interface subnets:
     */
    
        recursion no;
        // you'd probably want to deny recursion to external clients, so you don't
        // end up providing free DNS service to all takers
     
  20. webhostinghelps

    Joined:
    Sep 22, 2008
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Named.conf

    That is not issues in SoftLayer. It may due to version of OS, Version of Bind and type of named(chrooted)..
     
Loading...

Share This Page