PDA

View Full Version : [ubuntu] How to access intranet by hostname



essolo
May 5th, 2009, 09:47 AM
Hai, I'm new user use Ubuntu Server..

I install Ubuntu server in intranet on workstation.

the problem is, I cannot access my server use hostname... then I just can access by

Ip Address..

so how can I do?

thanks..

miegiel
May 5th, 2009, 10:01 AM
There are 2 ways to easily do this, each with their own (dis)advantages.

Run a DNS server/service on 1 of the machines on your network.
Add the server's name and ip# to all the workstations host file(s) on your network.

essolo
May 5th, 2009, 10:13 AM
There are 2 ways to easily do this, each with their own (dis)advantages.

Run a DNS server/service on 1 of the machines on your network.
Add the server's name and ip# to all the workstations host file(s) on your network.



but i have small LAN, I want to setup web base system.. so this system just on intranet.
No DNS. Just access like this http://servername/index.html

m3bik
May 5th, 2009, 10:14 AM
My DSL modem has a DNS server built in. I simply access my modem by the local IP and click the DNS link. I can then add hostnames and point them to any IP.

Don't know if you have this option, but it's worth a shot.

m3bik
May 5th, 2009, 10:17 AM
It works great for my intranet. Granted I use the local domain name "inet" so my servers are accessed by http://servername.inet/index.html

miegiel
May 5th, 2009, 10:30 AM
but i have small LAN, I want to setup web base system.. so this system just on intranet.
No DNS. Just access like this http://servername/index.html

You can use DNS to link LAN ip# to names too ;)
It's not just for the internet.

m3bik
May 5th, 2009, 10:36 AM
Just make sure that your TCP/IP settings for your LAN connection has the correct IP to your local DNS server.

essolo
May 6th, 2009, 01:02 AM
I don't have internet connection...

before i user ubuntu server, i just install xampp at my workstation on windows..

i just access workstation like http://servername/index.html

in ubuntu server, not running like that...

any configuration to I can access ubuntu like that?

miegiel
May 7th, 2009, 01:19 AM
I don't have internet connection...

before i user ubuntu server, i just install xampp at my workstation on windows..

i just access workstation like http://servername/index.html

in ubuntu server, not running like that...

any configuration to I can access ubuntu like that?

I guess this (https://help.ubuntu.com/8.04/serverguide/C/dns.html) is to difficult.

The simplest way is to edit /etc/hosts.

sudo gedit /etc/hosts
/etc/hosts explained in short here (https://help.ubuntu.com/8.04/serverguide/C/network-configuration.html). Scroll to the bottom and read Managing Hosts.

Doing it this way has the (dis)advantage that it's static, if the IP of the servermane changes you'll need to edit /etc/hosts again on the other PC. And it's little work, if you only need to do it on a few machines. Adding a line or 2 to /etc/hosts on a dozen machines is no fun at all :D

windependence
May 7th, 2009, 06:57 AM
I'm sure /etc/hosts is the best way to go here. He just has a small LAN. Most people don't need to and probably don't want to set up a full blown DNS server on their network.

-Tim