Community Forums
Connect with us on LinkedIn
Community Notice
Closed Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Nov 2004
    Posts
    28

    Question /etc/resolv.conf

    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.

    My details are:
    WHM 9.9.8
    cPanel 9.9.8-R119
    Fedora i686 - WHM X v3.1.0
    Kind Regards,
    Coffee23.

    www.SloganIT.com

  2. #2
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,310
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #3
    Member
    Join Date
    Nov 2004
    Posts
    28

    Default

    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
    Kind Regards,
    Coffee23.

    www.SloganIT.com

  4. #4
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,310
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by coffee23
    When i run /etc/hosts i get the following
    Post the contents of that file.

  5. #5
    Member
    Join Date
    Nov 2004
    Posts
    28

    Default

    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
    Kind Regards,
    Coffee23.

    www.SloganIT.com

  6. #6
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,310
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Should look something like this:

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

  7. #7
    Member
    Join Date
    Nov 2004
    Posts
    28

    Default

    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,
    Kind Regards,
    Coffee23.

    www.SloganIT.com

  8. #8
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,310
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #9
    Member
    Join Date
    Jun 2004
    Posts
    76

    Post

    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
    Last edited by picoyak; 11-23-2004 at 12:31 PM.

  10. #10
    Member
    Join Date
    Nov 2004
    Posts
    28

    Default

    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).
    Kind Regards,
    Coffee23.

    www.SloganIT.com

  11. #11
    Member FeeL's Avatar
    Join Date
    Apr 2004
    Location
    Rio de janeiro
    Posts
    142
    cPanel/Enkompass Access Level

    Reseller Owner

    Smile

    Quote Originally Posted by sawbuck View Post
    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.
    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!

    Also...
    Dont use the
    127.0.0.1 localhost
    line.

    Read the reason here:
    what should /etc/resolv.conf look like?
    Last edited by FeeL; 10-26-2007 at 08:15 PM. Reason: adding more info
    -----------
    FeeL Buarque
    SysAdmin.

  12. #12
    cPanel Product Evangelist Infopro's Avatar
    Join Date
    May 2003
    Location
    Pennsylvania
    Posts
    7,166
    cPanel/Enkompass Access Level

    Root Administrator

    Lightbulb

    Very old thread...

Similar Threads & Tags
Similar threads

  1. resolv.conf
    By jollymon in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 10-01-2006, 05:50 PM
  2. what should /etc/resolv.conf look like?
    By spaceman in forum cPanel and WHM Discussions
    Replies: 15
    Last Post: 04-28-2006, 04:14 PM
  3. /etc/resolv.conf
    By DataDork in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 05-09-2005, 04:59 AM
  4. /etc/resolv.conf what should be there
    By dunno in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-18-2003, 04:01 PM
  5. resolv.conf
    By elleryjh in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 07-13-2003, 12:11 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube