LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-21-2017, 01:15 AM   #1
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 401

Rep: Reputation: 32
How to resolve local LAN names


I have a typical workgroup with a windows box and a Slackware box. But the Slackware box can't resolve any local names. I can ping windows and Slackware from windows, but I can't ping either Slackware or windows from Slackware.

My router seems to resolve the names fine, as they are both listed in the 192.168.0.100 webapp client list.

I try to add 192.168.0.100 to resolv.conf, but that obviously does not work.

I edited /etc/nsswitch.conf and changed hosts: files dns to hosts: files wins dns, but that didn't work either. I don't think winbind is even running. Should I go through the trouble?

I can ping any website on the internet from Slackware and Windows.

Also, another weird thing, my internet "card" is labelled eth126, instead of the normal eth0.

/etc/rc.d/rc.inet1 restart produces no output and there is nothing to indicate in the start up routine that rc.inet1 executed at all.

I have to run dhcpcd eth126 to get internet working.

Ok, I'm going to sleep now. Thanks for reading. Hopefully, an answer will be provided in the morning.
 
Old 07-21-2017, 09:11 AM   #2
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
Are you running samba?
 
Old 07-21-2017, 09:19 AM   #3
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
It appears that you have a router at 192.168.0.100 that is configured to be the DNS server for your LAN.

If 'dhcpcd eth126' is working, then you will likely see your router's IP address in /etc/resolv.conf as the nameserver.
You could also test with 'host <Windows localname> 192.168.0.100' or 'dig @192.168.0.100 <Windows localname>

Quote:
Also, another weird thing, my internet "card" is labelled eth126, instead of the normal eth0.
I suggest checking the contents of /etc/udev/rules.d/70-persistent-net.rules.
You can simply delete that file and reboot, so that it will be automatically regenerated.

If the weird naming is fixed, then an entry to use DHCP for eth0 in /etc/rc.d/rc.inet1.conf should be all that is required.
Code:
# Config information for eth0:
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
 
1 members found this post helpful.
Old 07-21-2017, 01:10 PM   #4
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 401

Original Poster
Rep: Reputation: 32
Well, eth126 is now eth0, but still no name resolution. I could just put it in hosts, but then that would defeat the purpose of DHCP and I have other devices that connect to other networks that need to access the file share.

The Windows hosts file is empty.

I can SSH into Slackware from Windows with no issue.

If I do winbindd -D then I can resolve Slacware's name, but not Windows' name.

Last edited by hedron; 07-21-2017 at 01:13 PM.
 
Old 07-21-2017, 01:50 PM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member response

Hi,

For the Linux and windows system you can use '/etc/hosts' file;
Quote:
From 'man hosts';
hosts - static table lookup for hostnames

SYNOPSIS
/etc/hosts

DESCRIPTION
This manual page describes the format of the /etc/hosts file. This file is a simple text file that associates IP addresses with hostnames, one line
per IP address. For each host a single line should be present with the following information:

IP_address canonical_hostname [aliases...]

Fields of the entry are separated by any number of blanks and/or tab characters. Text from a "#" character until the end of the line is a comment,
and is ignored. Host names may contain only alphanumeric characters, minus signs ("-"), and periods ("."). They must begin with an alphabetic
character and end with an alphanumeric character. Optional aliases provide for name changes, alternate spellings, shorter hostnames, or generic
hostnames (for example, localhost).

The Berkeley Internet Name Domain (BIND) Server implements the Internet name server for UNIX systems. It augments or replaces the /etc/hosts file
or hostname lookup, and frees a host from relying on /etc/hosts being up to date and complete.

In modern systems, even though the host table has been superseded by DNS, it is still widely used for:

bootstrapping
Most systems have a small host table containing the name and address information for important hosts on the local network. This is useful
when DNS is not running, for example during system bootup.

NIS Sites that use NIS use the host table as input to the NIS host database. Even though NIS can be used with DNS, most NIS sites still use the
host table with an entry for all local hosts as a backup.

isolated nodes
Very small sites that are isolated from the network use the host table instead of DNS. If the local information rarely changes, and the net‐
work is not connected to the Internet, DNS offers little advantage.
For the MS Windows system lmhosts/hosts then look at; https://support.microsoft.com/en-us/...-windows-vista

Hope this helps.
Have fun & enjoy!
 
Old 07-21-2017, 03:07 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
I have 3 computers on my local network. A Windows 10 laptop (therapist), a Slackware 14.1 desktop/server (craven-moorhead), and a Slackware 14.2 htpc (febtober).

From my laptop, I am able to ping both my htpc and my desktop... but only if samba is running. I didn't have samba running on my htpc initially, and the pings failed. Once I started it, the pings went through.

Code:
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\Jeremy Brent Hansen>ping craven-moorhead

Pinging craven-moorhead [10.0.0.152] with 32 bytes of data:
Reply from 10.0.0.152: bytes=32 time=1ms TTL=64
Reply from 10.0.0.152: bytes=32 time=1ms TTL=64

Ping statistics for 10.0.0.152:
    Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms
Control-C
^C
C:\Users\Jeremy Brent Hansen>ping febtober
Ping request could not find host febtober. Please check the name and try again.

C:\Users\Jeremy Brent Hansen>ping febtober

Pinging febtober [10.0.0.125] with 32 bytes of data:
Reply from 10.0.0.125: bytes=32 time=1ms TTL=64
Reply from 10.0.0.125: bytes=32 time=1ms TTL=64
Reply from 10.0.0.125: bytes=32 time=1ms TTL=64

Ping statistics for 10.0.0.125:
    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 1ms, Maximum = 1ms, Average = 1ms
Control-C
^C
From either Slackware computer, I could ping the other without samba running, however, none can ping the Windows laptop, although, the correct IP address does get resolved.

Code:
jbhansen@febtober:~$ ping therapist
PING therapist (10.0.0.128) 56(84) bytes of data.
^C
--- therapist ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 4999ms

jbhansen@febtober:~$ ping craven-moorhead
PING craven-moorhead (10.0.0.152) 56(84) bytes of data.
64 bytes from craven-moorhead (10.0.0.152): icmp_seq=1 ttl=64 time=0.204 ms
64 bytes from craven-moorhead (10.0.0.152): icmp_seq=2 ttl=64 time=0.225 ms
64 bytes from craven-moorhead (10.0.0.152): icmp_seq=3 ttl=64 time=0.231 ms
64 bytes from craven-moorhead (10.0.0.152): icmp_seq=4 ttl=64 time=0.230 ms
^C
--- craven-moorhead ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.204/0.222/0.231/0.018 ms
I assume the Windows firewall prevents a response to the ping, but I'm too lazy to check since no machines need to contact the laptop. (I have no shares set up on the laptop.)

My hosts file is unused on all machines. My only DNS/nameserver on the network is my router (running DD-WRT).

Code:
jbhansen@febtober:~$ cat /etc/resolv.conf
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
nameserver 10.0.0.1
# /etc/resolv.conf.tail can replace this line
Here is a list of all active services on my htpc (which has many less than my desktop). Most are just the default services that are pre-selected with the installer.

Code:
jbhansen@febtober:~$ find /etc/rc.d/ -type f -perm /a+x | sort
/etc/rc.d/init.d/functions
/etc/rc.d/rc.4
/etc/rc.d/rc.6
/etc/rc.d/rc.K
/etc/rc.d/rc.M
/etc/rc.d/rc.S
/etc/rc.d/rc.acpid
/etc/rc.d/rc.avahidaemon
/etc/rc.d/rc.avahidnsconfd
/etc/rc.d/rc.bluetooth
/etc/rc.d/rc.cgmanager
/etc/rc.d/rc.cgproxy
/etc/rc.d/rc.consolekit
/etc/rc.d/rc.cpufreq
/etc/rc.d/rc.fuse
/etc/rc.d/rc.gpm
/etc/rc.d/rc.inet1
/etc/rc.d/rc.inet2
/etc/rc.d/rc.inetd
/etc/rc.d/rc.local
/etc/rc.d/rc.loop
/etc/rc.d/rc.mcelog
/etc/rc.d/rc.messagebus
/etc/rc.d/rc.modules
/etc/rc.d/rc.modules.local
/etc/rc.d/rc.ntpd
/etc/rc.d/rc.rpc
/etc/rc.d/rc.sshd
/etc/rc.d/rc.syslog
/etc/rc.d/rc.sysvinit
/etc/rc.d/rc.udev
/etc/rc.d/rc.ulogd
/etc/rc.d/rc.vboxautostart-service
/etc/rc.d/rc.vboxballoonctrl-service
/etc/rc.d/rc.vboxdrv
/etc/rc.d/rc.vnstat
/etc/rc.d/rc.wireless
 
Old 07-21-2017, 07:51 PM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
It appears that the OP is still failing to get an address by DHCP. I would suggest stopping any running dhcp processes. then running 'dhcpcd -d eth0' to look for any issues. It is possible that the timeout for dhcpcd in /etc/rc.d/rc.inet1 may need to be increased so that the DHCP negotiation can complete successfully.
 
Old 07-21-2017, 08:41 PM   #8
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 401

Original Poster
Rep: Reputation: 32
Now I see the problem. Windows' ping doesn't differentiate FQDN's from local workgroup names, but linux does. So, I guess everything is in order. nmblookup finds both machines fine.
 
Old 07-24-2017, 08:56 AM   #9
hedron
Member
 
Registered: Jul 2009
Location: NYC
Distribution: Slackware64-multilib 15.0, SARPI, artix
Posts: 401

Original Poster
Rep: Reputation: 32
This problem has come to a head, because I need cups but the only way to get access to my printer on my windows machine is by putting the hostname in cups.conf. But since I cannot resolve local names, I can't access my printer.

Nevermind, I just added allow from 192.168.* in cupsd.conf. I'd prefer names, but w/e.

Last edited by hedron; 07-24-2017 at 09:09 AM.
 
Old 07-24-2017, 09:49 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
While Windows can automatically resolve IP addresses via netbios broadcast messaging linux cannot. There are several ways i.e running a local DNS, using winbind/nssswitch.conf, Avahi/mDNS or the hosts file.

cups can use Avahi browsing to find printers if installed and compiled with libdns. I configure my printers to use a static IP address and so it is also defined the same in cups.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dns server not able to resolve local domain names mystika08 Linux - Networking 62 07-01-2009 05:23 AM
dns server not able to resolve local domain names mystika08 Linux - Newbie 3 03-19-2009 07:57 AM
DNS Problem - Can't resolve LAN IP's to names crazee64 Linux - Networking 3 07-12-2006 04:26 PM
dnsmasq wont resolve local names without suffix Rooboy Linux - Networking 0 10-07-2004 06:46 AM
Sendmail can't resolve names outside local network beng Linux - Networking 4 12-01-2003 12:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration