0

I'm using a custom Ubuntu and I can't seem to use a DNS resolver. I updated my /etc/resolv.conf file so it would contain the line nameserver 8.8.8.8:

# cat /etc/resolv.conf
nameserver 8.8.8.8

but that doesn't seem to help:

# ping google.com
ping: bad address 'google.com'
# ping google
ping: bad address 'google'
# ping www.google.com
ping: bad address 'www.google.com'

Accessing 8.8.8.8 as it is works:

# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=118 time=53.386 ms
64 bytes from 8.8.8.8: seq=1 ttl=118 time=53.398 ms
64 bytes from 8.8.8.8: seq=2 ttl=118 time=53.265 ms
64 bytes from 8.8.8.8: seq=3 ttl=118 time=53.293 ms
64 bytes from 8.8.8.8: seq=4 ttl=118 time=53.339 ms

I've tried looking for answers here but most of the suggestions were irrelevant, as I don't have /etc/resolvconf/resolv.conf.d/, /etc/network/interfaces or /etc/dhcp3/dhclient.conf.

  1. Could it be that I have another network configuration file that disables my /etc/resolv.conf (The Linux I run had many programmers touching it along the years, and no one actually knows what exactly happens anymore...)?
  2. How actually ping is executed? If I could understand when ping checks /etc/resolv.conf, maybe I could pinpoint why it isn't working

This is my /etc/nsswitch.conf:

#  cat /etc/nsswitch.conf
    passwd:     files  rf
    shadow:     files
    group:      files
    hosts:      files   dns
    services:   files
    networks:   files
    protocols:  files
    rpc:        files
    ethers:     files
    netmasks:   files
    netgroup:   files
    automount:  files
    aliases:    files
    bootparams:  [NOTFOUND=return] files

ps auxc | grep -i dns OR ps auxc | grep -i resolv

BusyBox v1.11.2 () multi-call binary

Usage: ps

Report process status

Options:
        w       Wide output
  • 1
    Does ping 8.8.8.8 work ? – Soren A Oct 10 '18 at 13:02
  • yeah, forgot to mention :-) Updated question – CIsForCookies Oct 10 '18 at 13:04
  • 1
    Can you post the contents of /etc/nsswitch.conf, if present? – Daniele Santi Oct 10 '18 at 13:06
  • @MrShunz from looking at http://man7.org/linux/man-pages/man5/nsswitch.conf.5.html, my nsswitch seems to be configured right (at least the hosts part, which is the relevant part, if I understand correctly) – CIsForCookies Oct 10 '18 at 13:10
  • 1
    nsswitch.conf looks correct, can you do nslookup google.com and/or dig google.com? – Daniele Santi Oct 10 '18 at 13:16
  • well, not exactly. I was quite sure I work on Ubuntu, but one of the guys here said we work on an in-house ltib version, so it is not exactly Ubuntu (although cat /etc/*{release,version} does call the release-host "ubuntu-desktop"). In short I have no dig / nslookup. Given this new info, I was under the impression that the existence of /etc/resolv.conf implies the functionality of a DNS resolver – CIsForCookies Oct 10 '18 at 13:21
  • Do you have a file /etc/netplan/01-netcfg.yaml? If so, can you add its content to your question – Nick Sillito Oct 10 '18 at 16:56
  • Do NOT manually edit your /etc/resolv.conf file. Edit your question with the output of cat /etc/resolv.conf and ps auxc | grep -i dns and ps auxc | grep -i resolv. Let me know when you have it at @heynnema – heynnema Oct 10 '18 at 18:36
  • @NickSillito No :-( – CIsForCookies Oct 11 '18 at 04:49
  • @heynnema BusyBox doesn't give anything useful :-( – CIsForCookies Oct 11 '18 at 04:52
  • Ah, you didn't say that you were at the BusyBox prompt. Type fsck -f /... if that doesn't work, type exit, then fsck -f /. Report back. – heynnema Oct 11 '18 at 12:41

1 Answers1

1

I am noob but I faced this issue just few day ago! I think you should recreate your resolve.conf file.

Use this command for recreation.

sudo resolvconf -u.

May be this helps!

  • This doesn't work on my machine [-sh: resolvconf: command not found], a sit is not exactly Ubuntu :-( I hoped it wasn't too far from Ubuntu, but I come to realize that it possibly is – CIsForCookies Oct 10 '18 at 14:07