LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-15-2005, 09:17 AM   #1
MurOllavan
LQ Newbie
 
Registered: Jun 2005
Distribution: Slackware 10.1
Posts: 9

Rep: Reputation: 0
Internet config screwy


I can ping the computers on my lan, my router and can even ssh into my buddy's computer. I can only use ip's. I cannot use anything but ping and ssh using ips. Any ideas? If you tell me what to post I will. Thanks.
 
Old 06-15-2005, 09:32 AM   #2
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Edit your /etc/hosts file and enter them as;

ip_address [tab] host_name

The host_name must be the same name specified in that host's /etc/hostname file.
 
Old 06-15-2005, 11:10 PM   #3
MurOllavan
LQ Newbie
 
Registered: Jun 2005
Distribution: Slackware 10.1
Posts: 9

Original Poster
Rep: Reputation: 0
I am not sure if I understand. This is my hosts file.
after comments...
127.0.0.1 localhost
127.0.0.1 shamrock.net shamrock //name of my pc
what should I do?
 
Old 06-16-2005, 03:05 AM   #4
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally posted by MurOllavan
I am not sure if I understand. This is my hosts file.
after comments...
127.0.0.1 localhost
127.0.0.1 shamrock.net shamrock //name of my pc
what should I do?
You cannot do this as 127.0.0.1 is reserved for localhost. If say your ethernet card has an address of 192.168.0.1 then in your hosts file it would be;

127.0.0.1 localhost
192.168.0.1 shamrock.net

now if your buddies ethernet card address is 192.168.0.3 and the name in his /etc/hostname file is abc.org then add this to your hosts file;

192.168.0.3 abc.org

This will allow name resolution by your system so if you have a home directory ( eg. john) on his system you can do from a console ssh john@abc.org. If he is running an Internet server you could enter in the address bar http://www.abc.org and it will show his index.html. You can speed up the loading of favourite sites by doing the same thing if you know the ip address of your favourite sites. Another useful tricks applied to this file is if you don't want adverts on web pages then resolve their addresses to localhost and because they aren't there, they won't be displayed eg.;

127.0.0.1 adbanners.bizland.com or

0.0.0.0 adbanners.bizland.com

Last edited by TigerOC; 06-16-2005 at 03:09 AM.
 
Old 06-16-2005, 03:57 AM   #5
MurOllavan
LQ Newbie
 
Registered: Jun 2005
Distribution: Slackware 10.1
Posts: 9

Original Poster
Rep: Reputation: 0
Ok. I believe I understand this. I replaced the localhost ip before my pc's name with the pc ip address. I still don't know what a localhost is, or why it needs an ip. But anyway.

This file's entries are there for BETTER name resolution, I would guess? It seems this file just makes aliases for ips. Or at least what I am looking for is somewhere else. On this pc I cannot access webpages at all, slow or fast. Do I have to know the ip address of everywhere before I can do anything? I can't get name resolution at all. Mozilla,lynx,etc don't work. On my windows laptop that I have yet to change to linux(to make sure I have something that can access the web, I'm on it now) I have two DNS entries from my ISP that I have to enter manually under netconfig, does this have anything to do with this?
 
Old 06-16-2005, 04:39 AM   #6
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
ip addresses are assigned to ethernet cards not systems. You'll understand this if you use 2 cards in a system because they have to be different subnets in order to work. You need localhost because that is the system ip address. Every system has a local address of 127.0.0.1.
Your other problem need to resolved using the DNS addresses given by your isp. These need to be entered in /etc/resolv.conf in the form;

nameserver <ip_address>

Your hosts file will provide name resolution within the network or lan and the DNS addresses will provide name resolution on the internet or wan.
 
Old 06-16-2005, 04:57 AM   #7
MurOllavan
LQ Newbie
 
Registered: Jun 2005
Distribution: Slackware 10.1
Posts: 9

Original Poster
Rep: Reputation: 0
Thank you. I have tried this once, my resolv.conf was rewrote as simply one nameserver, the router when I rebooted. Why is that?
 
Old 06-16-2005, 05:11 AM   #8
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Sometimes they use a different DNS and the system updates resolv.conf
 
Old 06-16-2005, 05:24 AM   #9
MurOllavan
LQ Newbie
 
Registered: Jun 2005
Distribution: Slackware 10.1
Posts: 9

Original Poster
Rep: Reputation: 0
Ok. It's resolving now. My best guess to keep this is to remove the writing permissions on the resolv file for all, so that it doesn't get changed anymore. Thank you for your help.
edit: I just put a script in the rc.local to change resolv last on boot to overwrite whatever was changing it. Thank you for your help.

Last edited by MurOllavan; 06-16-2005 at 05:45 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Partition table screwy? Ross Clement Linux - Hardware 3 07-17-2005 02:10 PM
Resolution screwy Linux nooB 454 Linux - General 2 03-20-2005 04:06 PM
Screwy Linux Xia Linux - General 12 03-08-2004 05:48 PM
my clock is screwy pcdebb Fedora 7 12-19-2003 10:34 PM
My Cable Is Screwy Today... ranger_nemo General 1 09-13-2003 12:56 AM


All times are GMT -5. The time now is 06:35 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration