LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I think i messed up my 2 files that tell linux to connect to the internet, help plz (https://www.linuxquestions.org/questions/linux-newbie-8/i-think-i-messed-up-my-2-files-that-tell-linux-to-connect-to-the-internet-help-plz-411688/)

mr_coffee 02-04-2006 04:30 PM

I think i messed up my 2 files that tell linux to connect to the internet, help plz
 
Hello everyone, For some reason I booted up the computer and no internet is working at all, but when i boot into windows it works fine. THese are the 2 files i messed with:
/etc/sysconfig/network
which now looks like this:
NETWORKING = YES
HOSTNAME = localhost.localdomain

and
/etc/hosts
127.0.0.1 localhost.localdomain localhost

and i thought that is what was orignally in the files, but now i cannot connect to the internet. Also when i boot up, It is taking forever to boot because for some reason its trying to determine the IP address of my 2 firewire ports, and yet nothing is even hooked up into them. I connect to the itnernet thorugh a cable modem. The ethernet is a Realtek card. And it was working fine. Its located at eth1, eth0 and eth2 are my firewire ports. I went iton the control pannel and deleted the network interfaces of all of my possible internet connections, eth0...eth2 and then went to set up eth1 which is the ethernet port by using create a new network interface. I said i wanted to set up a cable connection, and i just kept everything default and yet sitll no luck. I tried booting into root and it doesn't let me connect to the internet either. :( Any ideas? Thanks. This was working fine like a day ago!! It all started when i was trying to change my machine name. Now it says coffee@localhost. It use to say coffee@x1-a3-blah-blah-blah and it would work fine. But somtimes it would stop working when i would boot up and go into a terminal and i noticed all the times my internet stopped working is when suddenly my machine name changed to localhost. But now its always localhost and its because i i configured those files so it should still work with localhost! :cry:

jschiwal 02-04-2006 04:51 PM

Go in the MCC and give your computer a real hostname, such as coffee. The domain name is the name that you give your local network. localhost is an alias for your loopback interface. It is what a program would use as a hostname for a computer that it is running on. I'm not sure, but localdomain may be the network address alias of the "lo" (localhost) device, so that could be wrong also.

There are two root commands that you can use to set the hostname, and domainname. They are called "hostname" and "domainname". After changing either, you will need to restart KDE. The interface that connects to the cable modem isn't connected to the LAN, so you may need to get the domain name from DHCP.

mr_coffee 02-04-2006 07:32 PM

jschiwal thanks for the info, So how do i get the domain name fom the DHCP? and why would this keep me from connecting to the internet? Did you see anything obviously wrong with my files? Thank u!

jschiwal 02-05-2006 08:02 AM

You can make up a name for your Lan yourself. One way to do it is with the "domainname" command. Another, is using the Network Setup in the MCC.
Naming your computer localhost will cause a problem because that is the alias for the LO interface. Using that name on another computer for instance will reach that other computers LO interface rather than your computer.
I'm not certain about the consequences of naming your domain "localdomain", however, I think this would be an alias for the network address of the LO device. I.E. 127.0.0.0 and netmask 255.0.0.0 .

You could use localhost.localdomain when refering to your local machine offline. For example using root@localhost.localdomain to access root's mail on your host. This supplies a shortcut where the linklayer is bypassed, because it isn't necessary to access the network.

The dhcpd client service will supply your host's name "hostname" to the server. It will also gather information from the server and modify certain files such as /etc/resolv.conf with items such as the name server addresses.

I'm not even sure if the file you edited was the right one. It would be better using the "hostname" and "domainname" commands on your computer, or to go through the MCC. I used to use Mandrake, but I'm using SuSE right now. The /etc/sysconfig/network/config file on my laptop doesn't contain a reference to my hostname.

There is a trick that some people use. Suppose that there is a website or host that you don't want the computer to reach. Adding the name to the /etc/hosts file and giving it the fake address of 172.0.0.1 (The LO interface address) will prevent accessing that site. Read the /etc/host.conf file if you don't know why this would work.

mr_coffee 02-11-2006 09:51 AM

I still can't get online with linux! I don't know how i screwed the files up so bad to make it not work anymore. I totally deleted everything from /etc/sysconfig/network so that file is totally empty because i'm not on a network at all, all i'm doing is connecting to the internet through a cable modem . So when i go to set up my internet connection, do i select make a cable connection or a LAN connection? when my computer was working, i guess it was set to LAN but why? i'm not on a LAN! I'm pretty close to just reinstalling the whole Operating system so the default settings/files would be restored, isn't there any other easier way to fix this problem? I changed my host name so its not localhost as well, so now when I open the terminal it says coffee@w00t instead of coffee@localhost, still doesn't work though! :(


All times are GMT -5. The time now is 02:48 AM.