PDA

View Full Version : [ubuntu] How access computer by name not by IP



nicholasnet
December 26th, 2008, 06:45 PM
I work in a place where entire network is in windows domain. I am thinking to install one Ubuntu server for testing purpose basically a LAMP server with SSH. So, far I manged to install a server and access its pages by IP address. However I am trying to access its page by name like http://intranet not http://100.xx.xx.xx. Now the problem is network administrator often changes the IP of every computer. So, is there any way to achieve this via DHCP or anything else. So, that whenever I go to http://intranet it will route the traffic to this server.

I successfully did this with IIS so there must be some way to do this in UBUNTU as well using Apache.

Any suggestion....please...

gerbman
December 26th, 2008, 06:49 PM
A not-so-nice solution would be to edit the /etc/hosts file, adding a line like "x.x.x.x host"; however you'll need to change this each time your network admin assigns new IP addresses to the machines.

nicholasnet
December 26th, 2008, 07:37 PM
Thank you very much for the reply. I can make my IP static for that machine. But when I installed Ubuntu server I also installed Bind9 is this necessary?
Also can windows machine hit this Ubuntu server by name like http://intranet/

Is this possible to do in Ubuntu server?

gerbman
December 26th, 2008, 07:57 PM
Thank you very much for the reply. I can make my IP static for that machine. But when I installed Ubuntu server I also installed Bind9 is this necessary?
Also can windows machine hit this Ubuntu server by name like http://intranet/

Is this possible to do in Ubuntu server?

Just to be clear - you should edit the /etc/hosts file on the computer you will be using to access your Ubuntu server. The hosts file tells the current machine what the IP address is for a given host name. I guess I was assuming your non-server machine was running Ubuntu as well. If it's not, then this approach will not work.

I don't know what Bind9 does.

nicholasnet
December 26th, 2008, 08:41 PM
Bind9 is DNS server. It seems like your proposed idea won't work because Windows have to access this Ubuntu server with name like http://intranet

cariboo907
December 26th, 2008, 10:53 PM
You can edit the hosts file on your Windows computers, the same way you would in Ubuntu, I don't have a windows computer handy to tell you where the host file is located, but if you search for it you should be able to find it.

Jim

nicholasnet
December 27th, 2008, 05:22 AM
Thank you very much for the reply but I have many Windows installed computers so it is not possible for me to change host file of every single of them. I want to hit UBUNTU server by many different windows machine by name URL like http://intranet

Is this possible for intranet setup.

capscrew
December 27th, 2008, 07:46 AM
...I have many Windows installed computers so it is not possible for me to change host file of every single of them.

So how do they resolve Windows hostnames to IP addresses now? DNS is standard across Apple/Unix and Microsoft. If you are using AD you should be able to add the computer to the AD database (LDAP) and that should update the DNS server.

cariboo907
December 27th, 2008, 08:56 AM
I haven't used it, but there is a program called dnsmasq in the repositories, that should allow you to do what you want. Have a look here (http://www.enterprisenetworkingplanet.com/netos/article.php/3377351), for more info on dnsmasq

Jim

nicholasnet
December 29th, 2008, 09:03 PM
Thanks a lot for the reply. You guys were right I had to configure Windows DNS not Ubuntu to route the traffic to Ubuntu testing server. However I am not being to able to connect to MySql server from another machine even if I removed bind address.

Is there anyway to connect to mysql server from remote machine. It is saying Host 'user-telco.cdi' is not allowed to connect to this MySql server.

cariboo907
December 29th, 2008, 10:18 PM
What I do when setting up a mysql are the following commands, they must be run in the mysql console:


grant all privileges on *.* to <user>@'localhost' identified by '<password>' with grant option;

grant all privileges on *.* to <user>@'%' identified by '<password>' with grant option;

the <user>@'%' allows the user to connect remotely.

Jim

nicholasnet
December 29th, 2008, 11:22 PM
That worked perfectly. Thank you very much.http://ubuntuforums.org/images/smilies/icon_biggrin.gif