Results 1 to 9 of 9

Thread: "Unable to open /etc/resolv.conf"

  1. #1
    Join Date
    Sep 2011
    Beans
    6

    "Unable to open /etc/resolv.conf"

    I downloaded an nmap script from the internet in order to be able to display in Conky the IP addresses connected to my home network but when I run conky from console I get these errors :

    "mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers "

    "mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers"


    The weird part is that even with the errors mentioned before, when I run conky I still get the addresses of all the peripherals connected to my network.

    On terminal, I also ran the command sudo nmap -sP #.#.#.#/24 (# = my Ip) and still got the same errors but again, it listed all my IP's-.

    I'm currently running nmap version 5.2

    I would appreciate any help regarding this since I don't know much about nmap and networking.

  2. #2
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,116

    Re: "Unable to open /etc/resolv.conf"

    I am not familiar with any of the apps you mentioned, but have you double-checked if the /etc/resolv.conf file even exists in your system :
    Code:
    cat /etc/resolv.conf
    You don't need that file (or any DNS servers) to browse nodes on your local network. So they will get listed without it, there's nothing abnormal about it.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  3. #3
    Join Date
    Sep 2011
    Beans
    6

    Re: "Unable to open /etc/resolv.conf"

    Quote Originally Posted by varunendra View Post
    I am not familiar with any of the apps you mentioned, but have you double-checked if the /etc/resolv.conf file even exists in your system :
    Code:
    cat /etc/resolv.conf
    You don't need that file (or any DNS servers) to browse nodes on your local network. So they will get listed without it, there's nothing abnormal about it.
    Thank you for answering my cry for help, when I ran the command you posted it seems there isn't any file by that name.

    All I want is to be able to display on conky the IP's connected to my network, so If you know of another way to do this please let me know.

    Thanks

  4. #4
    Join Date
    Nov 2008
    Location
    United States
    Beans
    2,090
    Distro
    Kubuntu 11.10 Oneiric Ocelot

    Re: "Unable to open /etc/resolv.conf"

    Are there any spaces before or after the command?

    example:
    bad
    Code:
     cat /etc/resolv.conf
    good
    Code:
    cat /etc/resolv.conf
    Works fine here on all distributions.

    Code:
    cat /etc/resolv.conf
    ### /etc/resolv.conf file autogenerated by netconfig!
    #
    # Before you change this file manually, consider to define the
    # static DNS configuration using the following variables in the
    # /etc/sysconfig/network/config file:
    #     NETCONFIG_DNS_STATIC_SEARCHLIST
    #     NETCONFIG_DNS_STATIC_SERVERS
    #     NETCONFIG_DNS_FORWARDER
    # or disable DNS configuration updates via netconfig by setting:
    #     NETCONFIG_DNS_POLICY=''
    #
    # See also the netconfig(8) manual page and other documentation.
    #
    # Note: Manual change of this file disables netconfig too, but
    # may get lost when this file contains comments or empty lines
    # only, the netconfig settings are same with settings in this
    # file and in case of a "netconfig update -f" call.
    #
    ### Please remove (at least) this line when you modify the file!
    search hsd1.mi.comcast.net
    nameserver xx.xx.xx.xx
    nameserver xx.75.75.75

  5. #5
    Join Date
    Sep 2011
    Beans
    6

    Re: "Unable to open /etc/resolv.conf"

    Tried it your way just in case and I still get the same results :

    "cat: /etc/resolv.conf: No such file or directory"

    The weirdest thing is that my eth(0) connection is fine, I can see my router as well as the other computers on my network.
    Last edited by George Lama; October 10th, 2012 at 03:14 AM.

  6. #6
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,116

    Re: "Unable to open /etc/resolv.conf"

    Quote Originally Posted by George Lama View Post
    The weirdest thing is that my eth(0) connection is fine, I can see my router as well as the other computers on my network.
    ..^that does not require any nameservers, in the computer or on the network, as I mentioned earlier. So it's normal, not weird. What would be weird is if you can browse the internet without the help of any DNS servers.

    So can you browse the internet? If you can, please check
    Code:
    nm-tool | grep -i dns
    to see what DNS servers you are using.

    As for 'resolv.conf' file, I don't know why, but I can see in my 12.04 installation that it has been moved to /run/resolvconf directory, and the /etc directory now only has a symbolic link to it. But obviously you don't have even that symbolic link there, hence the cat command error.

    Please check if your /run/resolvconf directory has that file, and whether it has any entries in it (IIRC, it is only created (automatically) at the time of configuring the network for browsing internet) :
    Code:
    cat /run/resolvconf/resolv.conf
    If it is there, you can manually create a symbolic link to it in your /etc directory by:
    Code:
    sudo ln -st /etc /run/resovconf/resolv.conf
    (copy-paste the command to avoid errors)

    Alternatively, you can manually create that file in the /etc directory with :
    Code:
    echo "nameserver xx.xx.xx.xx" | sudo tee /etc/resolv.conf
    echo "nameserver yy.yy.yy.yy" | sudo tee -a /etc/resolv.conf
    where xx... and yy... are your preferred primary and secondary DNS servers.

    That said, I really can't say if that may fix your conky related problem as I'm not familiar with that application, nor what it does (I guess its time I get some info about it..).

    Besides, sometimes it is not necessary to have resolv.conf file to browse internet. For example, my ppp gprs connection has its own DNS servers, which are not included in my resolv.conf file.

    Beyond this, I think I can give any useful advice only after getting familiar with conky (for which, I may not have enough time right now).

    If it still doesn't help, please post the outputs of 'nm-tool' and the cat command above.
    Last edited by varunendra; October 11th, 2012 at 05:51 AM. Reason: To add ending double-quotes in echo commands. Thanks to George.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  7. #7
    Join Date
    Sep 2011
    Beans
    6

    Talking Re: "Unable to open /etc/resolv.conf"

    Quote Originally Posted by varunendra View Post
    ..^that does not require any nameservers, in the computer or on the network, as I mentioned earlier. So it's normal, not weird. What would be weird is if you can browse the internet without the help of any DNS servers.

    So can you browse the internet? If you can, please check
    Code:
    nm-tool | grep -i dns
    to see what DNS servers you are using.

    As for 'resolv.conf' file, I don't know why, but I can see in my 12.04 installation that it has been moved to /run/resolvconf directory, and the /etc directory now only has a symbolic link to it. But obviously you don't have even that symbolic link there, hence the cat command error.

    Please check if your /run/resolvconf directory has that file, and whether it has any entries in it (IIRC, it is only created (automatically) at the time of configuring the network for browsing internet) :
    Code:
    cat /run/resolvconf/resolv.conf
    If it is there, you can manually create a symbolic link to it in your /etc directory by:
    Code:
    sudo ln -st /etc /run/resovconf/resolv.conf
    (copy-paste the command to avoid errors)

    Alternatively, you can manually create that file in the /etc directory with :
    Code:
    echo "nameserver xx.xx.xx.xx | sudo tee /etc/resolv.conf
    echo "nameserver yy.yy.yy.yy | sudo tee -a /etc/resolv.conf
    where xx... and yy... are your preferred primary and secondary DNS servers.

    That said, I really can't say if that may fix your conky related problem as I'm not familiar with that application, nor what it does (I guess its time I get some info about it..).

    Besides, sometimes it is not necessary to have resolv.conf file to browse internet. For example, my ppp gprs connection has its own DNS servers, which are not included in my resolv.conf file.

    Beyond this, I think I can give any useful advice only after getting familiar with conky (for which, I may not have enough time right now).

    If it still doesn't help, please post the outputs of 'nm-tool' and the cat command above.
    First I would like to thank you for all your help, sorry I don't answer sooner but I'm at work all day and can only come into the forums when I get home in the evenings.

    My answers to your questions :

    "So can you browse the internet? If you can, please check
    Code:
    nm-tool | grep -i dns
    to see what DNS servers you are using."

    Yes I can browse the internet just fine, I'm actually doing port fowarding in my router to my pc and all works fine.

    Running the command you posted I get this result : DNS: 10.0.0.1

    Running this command " cat /run/resolvconf/resolv.conf " I get this output :
    " cat: /run/resolvconf/resolv.conf: No such file or directory "

    "Alternatively, you can manually create that file in the /etc directory with :
    Code:
    echo "nameserver xx.xx.xx.xx | sudo tee /etc/resolv.conf
    echo "nameserver yy.yy.yy.yy | sudo tee -a /etc/resolv.conf
    where xx... and yy... are your preferred primary and secondary DNS servers"

    Tried running the above command with this input : echo "nameserver 10.0.0.1 | sudo tee /etc/resolv.conf" but it didn't do anything, then while looking at the command I see that you had only one " so I searched the internet and found that the other " had to be placed right after the IP address so I used the command "echo "nameserver 10.0.0.1" | sudo tee /etc/resolv.conf and that did it.

    Problem solved my friend, no more errors when I run conky THANK YOUUUUUUUU !!!!!!!!

    When I run " sudo cat /etc/resolv.conf " I get " nameserver 10.0.0.1 "

    Thank u again for all your help.

    As for not knowing anything about Conky, well here is a Link that my give you and idea, but in short it is a program that can displayjust about any information regarding your pc , in my case conky displays CPU temp, CPU Mhz, CPU fan Revolutions, CPU voltage (running AMD FX-8120 so I like to keep an eye on my voltage),Top 3 applications regarding cpu consumption, total ram and available ram, top 3 applications regarding ram consumption, Hard drive temps and total, used and available space, also my upload and download speeds, internal and external IP addresses, and finally, all the ip's of all the connected periferals on my network.

    The best part is that you can configure Conky any way you like via a script and it can also display quite a lot more info than what I have.

    Here is the link for the conky homepage, that my give you a better idea of what I'm talking about :

    http://conky.sourceforge.net/


    Regarding NMAP, it is just a security scanner for windows, mac and linux, and can give you a lot of info regarding your network.

    Here is the homepage in case you are interested on checking it out : http://nmap.org/

    My friend, thank you so very very much for taking the time to help me out, gonna close this thread since you have solved my problem....

    Wish you the very best !!!

    Regards,

    George

  8. #8
    Join Date
    Mar 2010
    Location
    India
    Beans
    8,116

    Re: "Unable to open /etc/resolv.conf"

    Quote Originally Posted by George Lama View Post
    then while looking at the command I see that you had only one "
    Oops!! Can't say a slip of finger or or a slip of 'mind' or a normal malfunctioning of my cheap PS/2 -> USB adapter, but same mistake twice!! That's what happens if you copy-paste commands; let me correct it immediately..

    And thank 'YOU' for that info about conky. Actually there are many different commands/programs I've been using that give you all the info (in much detailed manner) that you mentioned about conky, but having them all in one place in a consolidated way is definitely great! [Yay.. 'we got us new toolz'..!!]

    Glad my half-cooked recipe could be helpful.
    Varun
    Help others by marking threads as [SOLVED], if they are. (See how)
    Wireless Script | Use Code Tags

  9. #9
    Join Date
    Sep 2011
    Beans
    6

    Re: "Unable to open /etc/resolv.conf"

    Quote Originally Posted by varunendra View Post
    Oops!! Can't say a slip of finger or or a slip of 'mind' or a normal malfunctioning of my cheap PS/2 -> USB adapter, but same mistake twice!! That's what happens if you copy-paste commands; let me correct it immediately..

    And thank 'YOU' for that info about conky. Actually there are many different commands/programs I've been using that give you all the info (in much detailed manner) that you mentioned about conky, but having them all in one place in a consolidated way is definitely great! [Yay.. 'we got us new toolz'..!!]

    Glad my half-cooked recipe could be helpful.
    I'm glad you found conky interesting and that I was able to contribute something back .

    BTW, there are tons of conky scripts on the internet, find one that you like and modify it to your taste and needs, that will save you tons of time in creating your script.

    Take good care my friend and again, thank youuuuuuuuu !

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •