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.

/etc/resolv.conf

Discussion in 'General Discussion' started by coffee23, Nov 22, 2004.

Thread Status:
Not open for further replies.
  1. coffee23

    coffee23 Active Member

    Joined:
    Nov 13, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I was just going through emails that could not be sent and noticed one saying something about it could not find the DNS for the server (host), and that i should look at /etc/resolv.conf to determin the problem.

    When i enter the above commant it comes up with the following:

    Code:
    /etc/resolv.conf: line 1: nameserver: command not found
    /etc/resolv.conf: line 2: nameserver: command not found
    /etc/resolv.conf: line 3: nameserver: command not found
    /etc/resolv.conf: line 4: nameserver: command not found
    /etc/resolv.conf: line 5: nameserver: command not found
    /etc/resolv.conf: line 6: nameserver: command not found
    
    i edited the file to the following:

    Code:
    nameserver: 00.00.000.00
    nameserver: 00.00.000.00
    nameserver: 00.00.000.00
    nameserver: 00.00.000.00
    nameserver: 00.00.000.00
    nameserver: 00.00.000.00
    
    And it came up with the following when /etc/resolf.conf was called:

    Code:
    /etc/resolv.conf: line 1: nameserver: command not found
    /etc/resolv.conf: line 2: nameserver: command not found
    /etc/resolv.conf: line 3: nameserver: command not found
    /etc/resolv.conf: line 4: nameserver: command not found
    /etc/resolv.conf: line 5: nameserver: command not found
    /etc/resolv.conf: line 6: nameserver: command not found
    
    Can someone please tell me why it is doing that ?

    Also everytime when i log into WHM it comes up with "Hostname A Entry Missing!" so i click the "click here" button and all i get is the following:
    Code:
    Found your hostname to be: host 
    Found your short hostname to be: host 
    Found your domain name to be: 
    Found your main ip to be: 00.00.000.00
    If this looks correct, 
    
    notice how the "domain" is blank ??? therefore i just cross off as last time i done that and changed the hostname i got a "licence invalid" error or something like that and i just had Cpanel/WHM reinstalled but now i have got 10 users on there and i dont want to risk there accounts, if you get me.

    I hope someone can help as i have spent just over a month trying to get it sorted and going through here (forum) and nothing seems to fix it. :confused:

    My details are:
    WHM 9.9.8
    cPanel 9.9.8-R119
    Fedora i686 - WHM X v3.1.0
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    First off you should be using an editor like pico, nano or vi. So for example nano /etc/resolv.conf.

    Then resolv.conf should look something like this:
    domain "server name"
    domain search "server name"
    nameserver "Main/Virtual IP of your server"
    nameserver "IP of name server 1"
    nameserver "IP of name server 2"

    Restart Bind after making changes.

    As far as "A" name host entry- what does /etc/hosts have in it?
     
  3. coffee23

    coffee23 Active Member

    Joined:
    Nov 13, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Thanks for the reply.

    I use "PuTTY" to view/edit the files.

    I entered what you said "should" be in the /etc/resolv.conf file and then went onto WHM and i no longer get the "A" name Host Entry Missing popup.

    When i run /etc/hosts i get the following:

    Code:
    /etc/hosts: line 3: 00.00.000.00: command not found
    /etc/hosts: line 4: 127.0.0.1: command not found
    
    Again thanks for your help with this :)
     
  4. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Post the contents of that file.
     
  5. coffee23

    coffee23 Active Member

    Joined:
    Nov 13, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Code:
    # that require network functionality will fail.
    # Do not remove the following line, or various programs
    00.00.000.00            host host
    127.0.0.1                 localhost
    
    The above is what it comes up with :confused:
     
  6. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Should look something like this:

    127.0.0.1 localhost
    "Server IP address" "Server name" (2nd line)
     
  7. coffee23

    coffee23 Active Member

    Joined:
    Nov 13, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Done that to look like the following and it still has not sorted out the "A entry for hostname".

    Code:
    127.0.0.1 localhost
    "00.00.000.00" "Server name"
    
    I dont get the annoying "popup" anymore (thanks) but if i goto DNS then "Add an A Entry for your Hostname" it still shows the following:

    Code:
    Found your hostname to be: host 
    Found your short hostname to be: host 
    Found your domain name to be: 
    Found your main ip to be: 00.00.000.00 
    If this looks correct,
    
    :confused:
     
  8. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    After changing /etc/hosts you need to reboot your server for changes to take effect. If that doesn't solve your problem then I would say you have 2 choices. Either go step by step thru your setup in WHM and confirm by checking the corresponding files in putty or just hire someone to sort it for you. Chirpy on this forum can make short work of resolving your problem.
     
  9. picoyak

    picoyak Well-Known Member

    Joined:
    Jun 10, 2004
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    6
    EDIT: I believe I was wrong. Reboot after seems to make things go more smoothly at least.

    At any rate, coffee, here's an example hosts file for you. Use it as an example, and substitute the name of your server and your own main ip
    Code:
    127.0.0.1 localhost
    123.345.456.678 coffee.coffeedomainname.com coffee
    So by this example...
    your hostname to be: coffee.coffeedomainname.com
    your short hostname to be: coffee
    your domain name to be: coffeedomainname.com
    your main ip to be: 123.345.456.678
     
    #9 picoyak, Nov 23, 2004
    Last edited: Nov 23, 2004
  10. coffee23

    coffee23 Active Member

    Joined:
    Nov 13, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Done that but it still shows the same as before however the /etc/hosts file now displays the updated.

    Thanks for all your help trying to get it sorted.

    I think i will get someone to take a look into it (see some peeps under the "ads" forum).
     
  11. FeeL

    FeeL Well-Known Member

    Joined:
    Apr 17, 2004
    Messages:
    135
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Rio de janeiro
    cPanel Access Level:
    Reseller Owner
    You dont have to reboot the server!
    a simple killall -HUP named should solve this.

    Dont reboot the server before changes...
    This is linux, not windows! :p

    Also...
    Dont use the
    127.0.0.1 localhost
    line.

    Read the reason here:
    http://forums.cpanel.net/showpost.php?p=210571&postcount=4
     
    #11 FeeL, Oct 26, 2007
    Last edited: Oct 26, 2007
  12. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,475
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Very old thread...
     
Loading...
Thread Status:
Not open for further replies.

Share This Page