LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-17-2013, 09:42 AM   #1
leadfree
LQ Newbie
 
Registered: Jul 2013
Location: Ireland
Distribution: Slackware
Posts: 17

Rep: Reputation: Disabled
Name resolution on office networked PCs.


Greetings.

I have two PCs on an office network.
The broadband modem/router is BT voyager 2110
The modem/router is set as DHCP host, and both PCs have DHCP active.
Currently one PC has Slackware 14 and the other has Slackware 10.2

I want to use telnet, ftp, X hosting etc from one PC to the other.

Problem:
While I can initiate ftp, telnet, ping etc using the IP address eg
ftp 192.168.1.2 I can't use the host names eg ftp bigpc.mydomain
I get the response
ftp: bigpc.mydomain: No address associated with name

One solution would be to use fixed IP addresses and edit the /etc/hosts file accordingly, but I prefer to use DHCP, and the IP addresses can change.

Are there some files I can edit to make PCs recognise host names?
named and bind seem daunting to configure and hopefully not necessary.

/etc/hosts and /etc/HOSTNAME files already have entries like this.

/etc/hosts:127.0.0.1 bigpc.mydomain
/etc/HOSTNAME: bigpc.mydomain

Help appreciated.

Last edited by leadfree; 07-17-2013 at 12:32 PM.
 
Old 07-17-2013, 02:37 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Hosts file is wrong.

You can add in your local ipv4 and ipv6 localhost entry but that isn't really needed.

The main issue is you put other ip and name in it to direct names to ip.

Example from MS web page.

192.102.73.6 trey.research.com

If you put that on all computers, any resolution that uses hosts for lookup of trey.research.com would return 192.102.73.6 before dns. An exception would be .pac files and such that configure proxy.

Last edited by jefro; 07-17-2013 at 02:41 PM.
 
1 members found this post helpful.
Old 07-17-2013, 04:25 PM   #3
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
You could do as I do with my home PCs and tell your router to reserve IP addresses for them so that it always gives them the same IP address when it receives a DHCP request from them. Then you can modify the hosts files as mentioned.
 
1 members found this post helpful.
Old 07-18-2013, 07:06 AM   #4
leadfree
LQ Newbie
 
Registered: Jul 2013
Location: Ireland
Distribution: Slackware
Posts: 17

Original Poster
Rep: Reputation: Disabled
I've just set fixed addresses in the router and /etc/hosts files, and it does the business. That fulfills my needs for now.
Thanks.

It would be nice to have automatic IP number assignment via DHCP so that transient computers will attach easily (I have been using it, but hostnames are not recognised as described above). I wonder if I'll have to implemtent named/bind, or is there an intermediate step that's easier?

Thanks for replys.
 
Old 07-18-2013, 12:52 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
You should be able to have fixed IP addresses for your machines through DHCP so that you can attach other machines and have them assigned IP addresses etc. automatically. One thing you can't have, unfortunately, is automatic name resolution without implementing a nameserver of some kind (as far as I am aware).
 
Old 07-18-2013, 02:29 PM   #6
jnielsen7
LQ Newbie
 
Registered: Feb 2013
Posts: 29

Rep: Reputation: Disabled
In dhcpd.conf you can assign hosts fixed IPs by specifying their MAC address, like:

Code:
host HOSTNAME
      {
         hardware ethernet 00:20:61:A1:B2:C3;
         fixed-address 192.168.0.100;
      }
On some DHCP servers you can have entries like that in /var/lib/dhcpd/dhcpd.leases (where you may have to delete existing leases) as well, but putting it in dhcpd.conf should make it global.

See the configuration of the dhcpd.conf file in this thread here:

http://www.linuxquestions.org/questi...d-conf-719024/

And O'reilly article here:

http://answers.oreilly.com/topic/84-...hosts-to-dhcp/

Last edited by jnielsen7; 07-18-2013 at 02:37 PM.
 
1 members found this post helpful.
Old 07-18-2013, 02:34 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
Linux never really spent much time working on translating names (non-FQDN) to ip addresses like MS did.

Hosts files are sort of good and bad.

Not really an easy way to implement linux host names like a wins server does.

Might be possible to use samba and ms tools to setup name resolution.

http://serverfault.com/questions/352...hen-linux-cant
 
Old 07-18-2013, 02:44 PM   #8
jnielsen7
LQ Newbie
 
Registered: Feb 2013
Posts: 29

Rep: Reputation: Disabled
Quote:
Originally Posted by jefro View Post
Linux never really spent much time working on translating names (non-FQDN) to ip addresses like MS did.

Hosts files are sort of good and bad.

Not really an easy way to implement linux host names like a wins server does.

Might be possible to use samba and ms tools to setup name resolution.

http://serverfault.com/questions/352...hen-linux-cant
Well, named as a DNS server isn't THAT bad. I use it, but the syntax does indeed take some getting used to. I've never set it up from scratch though. Mostly I just edit the files directly in /var/named (the db.[domainname] file), add one line like "host0001 IN A 192.168.1.100" to it, and then restart the daemon and it's done. Fairly easy once it's set up.

Edit: Oh, non-FQDN? Windows' %SystemRoot%\system32\drivers\etc\hosts file isn't really all that different than /etc/hosts. Not sure what more you need for local name mappings (if that's what you mean by non-FQDN).

Last edited by jnielsen7; 07-18-2013 at 02:51 PM.
 
Old 07-19-2013, 03:44 PM   #9
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,993

Rep: Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628Reputation: 3628
jnielsen7, I didn't see your post while I made mine, so my last comment wasn't directed at you. Sorry if it seemed that I was arguing or in conflict with you.


Location of hosts file within an OS shouldn't change how the process works I agree.

I had assumed he couldn't use your tip about dhcp config in the modem but maybe he can.

Last edited by jefro; 07-19-2013 at 03:47 PM.
 
Old 07-24-2013, 06:52 AM   #10
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by leadfree View Post

One solution would be to use fixed IP addresses and edit the /etc/hosts file accordingly, but I prefer to use DHCP, and the IP addresses can change.
This is the best solution. Why do you prefer DHCP for fixed computers? It doesnt improve anything you know.
 
  


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
is there a way to change the resolution of open office impress slide shows nkd Linux - Laptop and Netbook 0 11-05-2008 09:12 PM
Controlling processes on networked pcs linuxhippy Slackware 5 05-08-2005 07:41 PM
Good Distro for my office with 4 networked computers? SonoranFun Linux - Distributions 3 01-19-2005 04:00 PM
Internet sharing on Networked PCs running SuSE 9.0 (Pro) mookate Linux - Networking 3 04-04-2004 03:27 PM
Networked computer can't see page served from other Networked computer Travis86 Linux - Networking 2 12-30-2002 01:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:05 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