0

System correctly resolves external hostnames (bbc.co.uk for example) but will not resolve any internal (LAN) ones.

The question here is how to automate LAN lookups without having to modify hosts and the like. Boards in question are likely to be installed in networks with completely different DHCP/DNS servers.

The following tells me which server offered DHCP etc. Is there a mechanism to get this address into resolvf.conf or something similar?

$ sudo grep -R "DHCPOFFER" /var/log/syslog
Jan 17 14:32:14 dev-k1s dhclient[1438]: DHCPOFFER of 192.168.1.19 from 192.168.1.1

TAIA.

[Edit 1]

Added IP address of router which is both DHCP and DNS server

$ sudo cat /etc/resolv.conf
nameserver 192.168.1.1
nameserver 1.1.1.1
$ ping beeb4
PING beeb4 (192.168.1.72) 56(84) bytes of data.
64 bytes from BEEB4 (192.168.1.72): icmp_seq=1 ttl=128 time=10.3 ms
64 bytes from BEEB4 (192.168.1.72): icmp_seq=2 ttl=128 time=2.49 ms

[Edit 0]

~$ ping dev-k1s
PING dev-k1s (127.0.1.1) 56(84) bytes of data.
64 bytes from dev-k1s (127.0.1.1): icmp_seq=1 ttl=64 time=0.083 ms

Attempting to ping another machine on the same network:

$ ping beeb4
ping: beeb4: Name or service not known

Various configuration details:

$ ip route
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.19
$ sudo cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 8.8.8.4
$ sudo cat /etc/nsswitch.conf

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          dns files
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

1 Answer 1

0

You're confusing DNS service and hostname resolution which are not declared in the DNS server. You can ping dev-k1s because this is the hostname of your own machine where you opened the terminal. The name and IP address list should in the /etc/hosts file. You should something like this on dev-k1s server :

~# more /etc/hosts
127.0.0.1       localhost
127.0.1.1       dev-k1s

So the ping to dev-k1s is responding with the localhost address ( 127.0.0.1) .

If you want your local server responding to ping command with its hostname you should add the IP adresse and the hostname associated at the bottom of the /etc/hosts file like this example :

127.0.0.1       localhost
127.0.1.1       dev-k1s
xxx.xxx.xxx.xxx beeb4

More info Click Here

I recommend you to ping its IP address first anyway

2
  • Thank you dubis. I have tried to better phrase my question. See edits above.
    – J Evans
    Commented Jan 17, 2019 at 15:29
  • The solution didn't change you've to add the ip address of beeb4 in your hosts file as you don't have local DNS server.
    – dubis
    Commented Jan 17, 2019 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .