Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
07-17-2013, 09:42 AM
|
#1
|
LQ Newbie
Registered: Jul 2013
Location: Ireland
Distribution: Slackware
Posts: 17
Rep: 
|
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.
|
|
|
07-17-2013, 02:37 PM
|
#2
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
07-17-2013, 04:25 PM
|
#3
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
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.
|
07-18-2013, 07:06 AM
|
#4
|
LQ Newbie
Registered: Jul 2013
Location: Ireland
Distribution: Slackware
Posts: 17
Original Poster
Rep: 
|
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.
|
|
|
07-18-2013, 12:52 PM
|
#5
|
LQ Addict
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
|
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).
|
|
|
07-18-2013, 02:29 PM
|
#6
|
LQ Newbie
Registered: Feb 2013
Posts: 29
Rep: 
|
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.
|
07-18-2013, 02:34 PM
|
#7
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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
|
|
|
07-18-2013, 02:44 PM
|
#8
|
LQ Newbie
Registered: Feb 2013
Posts: 29
Rep: 
|
Quote:
Originally Posted by jefro
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.
|
|
|
07-19-2013, 03:44 PM
|
#9
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
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.
|
|
|
07-24-2013, 06:52 AM
|
#10
|
Member
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731
Rep: 
|
Quote:
Originally Posted by leadfree
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.
|
|
|
All times are GMT -5. The time now is 11:13 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|