LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Naming My Computer and stuff (https://www.linuxquestions.org/questions/linux-newbie-8/naming-my-computer-and-stuff-205022/)

mst700 07-14-2004 02:56 PM

Naming My Computer and stuff
 
I need some assistance, what are the proceedures in naming my machine

I know this is a very basic question for some, I have not gotten it yet. I have the name localhost.localdomain as default for my machine. I would like to name it something else and be able to have my other computers see this.

I know that if I change my host name and things like that I lose INTERNET connectivity, so I want to understand what are the correct procedures.

If there is an article that explains it in "newbian talk" please direct me, or explain it so I can go to the correct files.




:study: mst700:study:

Newbies will one day be the masters!

acid_kewpie 07-14-2004 02:59 PM

just use the hostname command as root. e.g. "hostname l33t_h4X0rz_boxen" or whatever takes your fancy.

scuzzman 07-14-2004 03:07 PM

will this be permanent, or just for that one session?

Electro 07-14-2004 03:50 PM

It will only use the domain name and hostname that you change to until you reboot. If you want to make it permanent, add the same commands that you entered at the console in rc.local. You have to be as root to edit rc.local. There are other ways too, like adding or editing a line or two in sysctl.conf. Below is the sysctl lines that you can add or edit in sysctl.conf.

kernel.domainname = localhost.localdomain
kernel.hostname = localhost.localdomain

You can type "service network restart" to reactivate your network connection.

mst700 07-14-2004 05:58 PM

Thanks acid_kewpie for the links
 
Quote:

the Rute users guide, all you need to know to get going
How to ask good questions - please read!
These are very helpful links thank you.


Thanks Electro for making it clear.

:study: mst700:study:

Newbies will one day be the masters!

javageek 07-14-2004 06:35 PM

setting your host name
 
depending on your distribution, there are several utilities that can help you configure it.
for example: Suse uses yast, redhat depending on version uses ntsysv or linuxconf,
Mandrake depending on version uses linuxconf - newest version uses their propriatory control center which is available in graphical and text mode (Configure my computer in graphical mode or mcc under text mode)

Alternatively you can install linuxconf on any distribution!

mst700 07-15-2004 07:46 PM

[B]Naming my computer kicks me off the internet.[/B]
 
Naming my computer kicks me off the internet.

Can anyone tell me what I am doing wrong? I have completed this step:

Quote:

It will only use the domain name and hostname that you change to until you reboot. If you want to make it permanent, add the same commands that you entered at the console in rc.local. You have to be as root to edit rc.local. There are other ways too, like adding or editing a line or two in sysctl.conf. Below is the sysctl lines that you can add or edit in sysctl.conf.

kernel.domainname = localhost.localdomain
kernel.hostname = localhost.localdomain

You can type "service network restart" to reactivate your network connection.
I can't connect to the internet after I make the change, so I return my files to orginal condition and I connect with np.


:confused: mst700:confused:


Newbies will one day be the masters!

Electro 07-16-2004 12:43 AM

How are you connected to the internet?

Are connected straight to the modem like cable or xDSL?

Are you connected to a dial-up service?

If you are connected straight to a cable or xDSL modem, I can see you are having problems. Some ISP uses either hostname and domainname to look up you on their server. Other ISP uses the MAC address of your computer instead of the MAC of the modem. Using the MAC address from the modem makes it easy for you to change the hostname or domainname of your computer. Using a router, you can change your IP address, your MAC address, domainname, and hostname on your computer.

You can also try "service internet restart".

mst700 07-16-2004 06:17 PM

My current configuration
 
I am currently configured like this:

Config #1

ISDN ext modem --> WINXP SP2 machine --> Linux box
--> WINXP SP2 second machine
--> Mac Laptop


I want to make the linux machine the DNS/HTTP/Gateway etc..... and have a router connected to the linux box so the other computers can connect. Like this:

Config #2

ISDN ext Modem ---> Linux Box ---> Router ---> WINXP SP2
---> WINXP SP2
---> Mac Laptop
---> WEBCAM #1
---> WEBCAM #2
---> WEBCAM #3


So, my biggest question is who do I get the Linux box named and work from there. My ISP doesn't have any problem with me naming my WIN machine, so I was confussed why the linux machine would? I really want to work with config #2 as my network because I have to reboot WIN machines every 3 days or so and didn't want to have to do it.


P.S> My ISDN ext modem needs a computer to work so that is why I have a machine on the out side of the router. I can make the ISDN machine connect to the internet with my settings hostname= localhost, domainname =localdomain. I want to make to name my linux box Penguingateway and my local area net as geek.net. so it would look like Penguingateway.geek.net

Any help is welcome.

:study: mst700:study:

Newbies will one day be the masters!

jamuz 07-16-2004 07:00 PM

Referring to your Config #2---

If you configure your linux box as a gateway you don't need a separate router. A hub (or better, a switch) is a simpler, less expensive and functionally adequate interface to all the other boxes. Just be sure to get a hub or switch with enough ports---eight minimum for your Config #2.

Best wishes.

mst700 07-16-2004 10:23 PM

Route or Switch
 
I that sound great except I have a i707 D-Link Route/Switch already, so I was going to go with the config #2. This still don't help/explain why I can't name my computer.


:study: mst700:study:

Newbies will one day be the masters!

mst700 07-17-2004 07:43 PM

WOOT
 
got the name changed

Only problem is I get a flag error saying can't find IP address for PeguinGateway.geek.net (my gateway linux machine)
So I assume I have defined something that makes the DNS/DHCPD want to go to the net and look for the IP address. I might be a little confused on procedure. Can anyone tell me what kind of network I should be running:

I have:

ISDN ext modem----> Linux box ----> D-Link i707p Router ---->

WINXPSP2
WINXPSP2
Mac Laptop
WEBCAM #1
WEBCAM #2

I want to be able to have all ip's connect to the INTERNET via ISDN modem/Linux box. Should I be setting up a different type of DNS/dhcpd? If you want I can make available my /etc/hosts, /etc/rc.local, /etc/syscfl.conf, /etc/dhcpd.conf files. If you think that will help?]

Please advise.


:scratch: mst700:scratch:

Newbies will one day be the masters!

frob23 07-17-2004 08:06 PM

/etc/hosts
/etc/dhcpd.conf

And /etc/resolv.conf

With these files we might be able to spot what is going on. There is one other file where the problem might be but I don't think so.

Also... do all the computers have a hosts file so they can find each other by name?

mst700 07-17-2004 08:14 PM

Quote:

With these files we might be able to spot what is going on. There is one other file where the problem might be but I don't think so.
My other machines are windows XP, and MAC. I don't know how they work as far as hosts files. I will post my files shortly. I am at work now until 0800Z. I will post then.

Electro 07-17-2004 11:42 PM

The hosts file in LINUX is the samething in Windows and MAC. In your hosts file in LINUX, do not remove the line that says localdomain. Just leave it and add your server name.

Did you disable dhcp in your router. Is WAN port not connected because if it is I can see you are having problems.

Use only the ports on the router that are a switch hub not WAN.

To make it easy, only setup DHCP server on the LINUX system. Then if you really need DNS, you can set it up. After you got your network working, you may want to setup squid or web cache service. Do not forget to setup firewall like iptables.

To make sure your setup works connect a crossover ethernet cable from any of your systems to the LINUX system. If it works then you can use the the switch hub.

I suggest getting either cable or xDSL because ISDN is much, much slower than cable and xDSL. The prices of cable and xDSL has changed a lot when ISDN was around. Both cable and xDSL is very easy to use. You just hook it up to the wan port of your router and all your systems can be connect to the internet.

I suggest looking at some documentation at tldp.org.

mst700 07-18-2004 04:37 AM

Here are my three files hosts resolv and dhcpd
 
The follwing are my files:

/etc/hosts:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.1 PenguinGateway.geek.net PenguinGateway

/etc/dhcpd.conf:
ddns-update-style interim;
ignore client-updates;

subnet 192.168.0.0 netmask 255.255.255.0 {

# --- default gateway
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;

option nis-domain "geek.net";
option domain-name "geek.net";
option domain-name-servers 192.168.0.1;

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.0.1;
# option netbios-name-servers 192.168.0.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.0.10 192.168.0.199;
default-lease-time 86400;
max-lease-time 86400;

# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
}


and /etc/resolv.conf:

search localdomain
nameserver 205.152.144.23
nameserver 205.152.37.23


I have had to disable all my network systems (dns and router/dhcp) to get my link box up on the internet. So I can make this post.

frob23 07-18-2004 05:58 AM

Uhm, why do I see 4 different addresses for your nameserver?

option domain-name-servers 192.168.0.1;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
nameserver 205.152.144.23
nameserver 205.152.37.23

This might be just me... but if this computer is serving addresses all the computers that get one will only use 192.68.0.1 as their nameserver.

The computer you say is the nameserver will be running at the 207.x.x.x address which none of the others know about (how can they since they can't do a name lookup without a working nameserver)

Do you have a functional nameserver at 192.68.0.1?

Uhm, I can't think of other things but there have to be some. It seems like it works when you kill dhcp because it can then use the addresses in resolv.conf which are probably valid.

mst700 07-19-2004 11:41 AM

That is the question.
 
Quote:

Uhm, why do I see 4 different addresses for your nameserver?

option domain-name-servers 192.168.0.1;
# we want the nameserver to appear at a fixed address
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}
nameserver 205.152.144.23
nameserver 205.152.37.23

This might be just me... but if this computer is serving addresses all the computers that get one will only use 192.68.0.1 as their nameserver.

The computer you say is the nameserver will be running at the 207.x.x.x address which none of the others know about (how can they since they can't do a name lookup without a working nameserver)

Do you have a functional nameserver at 192.68.0.1?

Uhm, I can't think of other things but there have to be some. It seems like it works when you kill dhcp because it can then use the addresses in resolv.conf which are probably valid.
OK, you got me. I haven't figured that part out yet. Can you advise me on what I should set up first and how (if not how, explain what I should be doing. I doesn't look like I have a clue what I am doing. I thought I did and that is could be the problem.) If you could explain what I need to do it would help. (i.e. set up nameserver) If I am to use my IP address as the ns IP I can do that, I just haven't ever set it up using linux before. I have setup NT servers but not this.

frob23 07-19-2004 12:02 PM

Okay, from the looks of it I would change
"option domain-name-servers 192.168.0.1;" to
"option domain-name-servers 205.152.144.23, 205.152.37.23;"

I am pretty sure that these nameservers are working for you. These are probably the ones provided by your isp. That should make everything work until you setup your local nameserver -- if you really want to.

If you are going to setup a local nameserver at 192.168.0.1 which will be called ns you should change:
host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 207.175.42.254;
}

to

host ns {
next-server marvin.redhat.com;
hardware ethernet 12:34:56:78:AB:CD;
fixed-address 192.168.0.1;
}

You would not need to do this if your DHCP server ran on 192.168.0.1 since it would already know its own ip address from your setup when it boots.

Note: You do not need your own nameserver unless you are really having problems with getting hosts to figure out each other's names -- it is more work to setup than it would be to find an error on the host.

All you need to do is make sure /etc/hosts on each machine contains the names and ip addresses for every computer on the network... an example from mine (change numbers and everything as fits your network). There are really very few applications where you will want to setup your own nameserver and it is a lot harder than copying one file onto each machine ... as long as you only have a few machines.

::1 localhost
127.0.0.1 localhost
#
# RFC 1918 specifies that these networks are "internal".
# 10.0.0.0 10.255.255.255
# 172.16.0.0 172.31.255.255
# 192.168.0.0 192.168.255.255

172.23.23.1 route.foo.org route ybrickrd
172.23.23.2 host02.foo.org host02
172.23.23.3 host03.foo.org host03

mst700 07-19-2004 12:15 PM

DHCP is the life for me
 
Thanks for the assistance frob23, this is what I was missing in my understanding department. I was missing the critical data (I had no clue). I will set this up tonight when I get off of work. I plan on just running the dhcp and let my ISP provide the rest.

skibum58 07-19-2004 04:54 PM

mst700 shows location as Ascension Island SAO. Many areas outside the US enjoyed large ISDN market penetration before onset of xDSL / Cable. I saw it happen in Germany.

You still see lots of areas with high concentration of ISDN and no other services to speak of. Maybe internet by satellite ?

Übernoob

mst700 07-19-2004 05:08 PM

On Ascension Island, I use ISDN via satellite. We don't have any hard lines to this island, It is to remote.

mst700 07-21-2004 12:30 AM

I finally connect
 
[I]I now connect to the internet when dhcpd is on./I]


The truth is my linux box (router/DHCPD) can connect to the internet and it also gives out dhcp's to all the systems, but the systems otheran than the linux box can't connect to the internet:

/etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.1 penguingateway.geek.org penguingateway


/etc/dhcpd.conf

ddns-update-style interim;
#ignore client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 {

# --- default gateway
option routers 192.168.1.1; (ip addr of the local linux box)
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.1;

# option nis-domain "geek.org";
# option domain-name "geek.org";
# option domain-name-servers 205.152.144.23, 205.152.37.23;
# option ip-forwarding off;
# option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.1.5 192.168.1.254;
default-lease-time 86400;
max-lease-time 86400;
# host penguingateway.geek.org {
# hardware ethernet 00:50:70:2A:2A:95;
# fixed-address 192.168.1.1;
# we want the nameserver to appear at a fixed address
host ns {
next-server penguingateway.geek.org; (my local linux box)
hardware ethernet 00:50:70:2A:2A:95;
fixed-address 192.168.1.1;
}
}

/etc/sysconfig/network

NETWORKING=yes
HOSTNAME=penguingateway.geek.org


/etc/resolv.conf

search geek.org
nameserver 205.152.144.23 (bellsouth DNS)
nameserver 205.152.37.23 (bellsouth DNS)

I am making very slow progress, I would like to make the linux box a ROUTER/DHCP server and Bellsouth (ISP) provide DNS information. I think I have all the information required? Please tell me were I went wrong and how to fix it?

route display:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
penguingateway. localhost.local 255.255.255.255 UGH 0 0 0 lo
d205-152-239-13 * 255.255.255.255 UH 0 0 0 ppp0
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
169.254.0.0 * 255.255.0.0 U 0 0 0 eth0
default d205-152-239-13 0.0.0.0 UG 0 0 0 ppp0



Should I go and set up IP_Masquerade? I down loaded a Howto.pdf on it, it looks like what I think I should be doing? Anyadvise?



mst700 07-22-2004 09:02 PM

WOOT
 
All my troubles where solved by a simple script file called Firestarter Firewall. It fixed my bridging problem I didn't know I had. My problem was my ppp0(ISDN) connection and my eth0 (gateway/DHCP) connection weren't talking. Thanks for the script Firestart.


All times are GMT -5. The time now is 05:46 PM.