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.

resolv.conf rewritten on every boot -- Help!

Discussion in 'General Discussion' started by 3p6hsmg, Jan 7, 2013.

  1. 3p6hsmg

    3p6hsmg Member

    Joined:
    Dec 1, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    This is a very annoying issue. Everytime the server boots the resolv.conf file is rewritten. This might not seem like a problem, but whatever is writing it does not include the "search [hostname]" line in the resolv file so any non-resolvable domains get resolved to my local IP address! (who thought up that piece of genius I wonder?)

    Is there a way to either make cpanel not rewrite this file or at the very least to write the thing correctly so every non-existant domain in the world does not point back to my local server?
     
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    It's not cPanel doing that, it's your operating system.
     
  3. 3p6hsmg

    3p6hsmg Member

    Joined:
    Dec 1, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Do you know where I can look to resolve this? Or what part of the OS is rewriting this? I literally just have CentOS with cpanel installed on it without customization. It is a Xen VPS.
     
  4. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Maybe in
    /etc/sysconfig/network-scripts/network-functions
     
  5. pmc

    pmc Member

    Joined:
    May 13, 2012
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Just chattr i the resolv.conf file
     
  6. optize

    optize Well-Known Member

    Joined:
    Apr 27, 2005
    Messages:
    144
    Likes Received:
    0
    Trophy Points:
    16
    Sounds like you're using DHCP instead of static IP addresses. DHCP will send DNS servers (usually) when you request an IP address/reboot.
     
  7. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    This does sound like behavior caused by DHCP, but not necessarily. My suggestion would be to work with your data center to find the cause of this, since it is something in the operating system, or in the virtualization software (Xen), not cPanel, doing it.

    The last thing I would do is apply the immutable attribute (chattr +i) to any file, because you can expect to forget about it and for it to cause problems later on after it has been forgotten, and troubleshooting can be very difficult when one does not remember to look for altered file attributes. There is usually a better way to handle a problem than changing a file's attributes.
     
Loading...

Share This Page