Results 1 to 9 of 9

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

Hybrid View

  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
    7,920
    Distro
    Ubuntu 12.04 Precise Pangolin

    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
    7,920
    Distro
    Ubuntu 12.04 Precise Pangolin

    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

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
  •