LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-13-2008, 01:29 PM   #1
mboudro
LQ Newbie
 
Registered: Nov 2008
Posts: 6

Rep: Reputation: 0
Accessible via host name without DNS


I have a server running Apache 2 and Samba that is generally used as a development server. I set up a simple Samba configuration so I could map the network drive to my PC and access the files as such. I know I can access it though the local IP address with a browser, but some of the others in my company have trouble remembering IP addresses. On the previous server I configured, I could access it by typing in the hostname of the server, "example", into the browser and it would automatically connect to said server.

With the new development server I configured, I am unable to get it to function like that again. It may have been something in the hosts configuration file, but I've tried everything with no avail.

How would I configure my server to be accessible, locally, via the hostname in a browser without using DNS?

Last edited by mboudro; 11-13-2008 at 01:34 PM.
 
Old 11-13-2008, 02:25 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by mboudro View Post
I have a server running Apache 2 and Samba that is generally used as a development server. I set up a simple Samba configuration so I could map the network drive to my PC and access the files as such. I know I can access it though the local IP address with a browser, but some of the others in my company have trouble remembering IP addresses. On the previous server I configured, I could access it by typing in the hostname of the server, "example", into the browser and it would automatically connect to said server.

With the new development server I configured, I am unable to get it to function like that again. It may have been something in the hosts configuration file, but I've tried everything with no avail.

How would I configure my server to be accessible, locally, via the hostname in a browser without using DNS?
By adding an entry into the hosts file on your local machine. Otherwise, a host name lookup won't work, since the entry won't be in DNS. Got to have some place to associate an address with a name.
 
Old 11-13-2008, 05:39 PM   #3
latinmusic74
Member
 
Registered: Jun 2007
Posts: 118

Rep: Reputation: 16
vim /etc/hosts

ipaddress servername //This map the ipadress with the server name.
 
Old 11-13-2008, 07:30 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
The thing about /etc/hosts is that the name -> ip conversion is only avail on that machine. Every host that needs to know where your server is would need to add that to their hosts file as well.
 
  


Reply



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
Bind9 ,host does reslove a dns name but ping says unknown host Byenary Linux - Networking 10 01-12-2011 01:33 AM
host resolve via dns shan_nathan Linux - Server 2 10-01-2008 12:18 AM
configuring DNS to host domains walidaly Linux - Server 14 04-01-2007 01:44 PM
DNS public host marius_vl Linux - Networking 5 06-01-2006 07:35 AM
Can use host dns but not my dns arkeni Linux - Networking 2 06-13-2004 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:20 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
Open Source Consulting | Domain Registration