LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-27-2010, 05:10 AM   #1
Smophos
LQ Newbie
 
Registered: Jul 2010
Location: I call my home Leeds, England
Distribution: Ubuntu 10
Posts: 13

Rep: Reputation: 3
Problems adding hosts to an Ubuntu machine, have read the manual


I'm quite new to all of this and I have tried a reference book and the man pages and I think it's me but I can't find anything helpful that will work.

When I started at the company I work for they set me up with a file with a list of hosts and their IP addresses. However I have had to reinstall 'Buntu so I've lost all this information.

I've tried using 'vi hosts' but it brings up a new blank file.

I've also tried using:
route add [-net|-host] <IP/Net> netmask <Mask> gw <Gateway IP> dev <Int>X

But not sure what <Int>, dev or X are supposed to stand for, everything else is fine. I also receive this error:
route: netmask 000000ff doesn't make sense with host route


Any help would be greatly appreciated.
 
Old 07-27-2010, 05:15 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
I am not sure what your problem is.
 
Old 07-27-2010, 05:22 AM   #3
Smophos
LQ Newbie
 
Registered: Jul 2010
Location: I call my home Leeds, England
Distribution: Ubuntu 10
Posts: 13

Original Poster
Rep: Reputation: 3
My bad!

I need to be able to get onto websites I use for work... If I type in the URL or the IP address I have, my PC can't find those websites. I'm supposed to be doing work from home.

I've got a list of IP addresses here and I just want to add them to the hosts/route file.

All I need is where I can find it.
 
Old 07-27-2010, 05:56 AM   #4
kindofabuzz
Member
 
Registered: Mar 2010
Location: There
Distribution: Linux Mint 17.1
Posts: 237

Rep: Reputation: 45
the hosts file is /etc/hosts
So, sudo nano /etc/hosts
 
Old 07-27-2010, 06:29 AM   #5
alli_yas
Member
 
Registered: Apr 2010
Location: Johannesburg
Distribution: Fedora 14, RHEL 5.5, CentOS 5.5, Ubuntu 10.04
Posts: 559

Rep: Reputation: 92
Hi

I think you're confusing terms. What you need to configure is your DNS servers that look-up domain names.

On Linux there are two locations of interest here:

1. /etc/hosts - you can consider this your internal DNS - since you have to add in an IP and a domain name to resolve to that IP. So if you add in:
Code:
10.0.0.1    server.domain.com   server
Every time you refer to server or server.domain.com (in your browser for example); your machine will locally resolve the domain to 10.0.0.1

2. /etc/resolv.conf - this is a file that contains a listing of external/public DNS servers available to you. This should contain at least one public DNS that's able to resolve any domain you request - you can use the Google DNS as an example and this will work perfectly.

Another file that is of importance is /etc/nsswitch.conf - in this file you set which DNS is looked up first (that is the internal or external as described in 1 and 2 above).

If you have a list of DNS server IP's; you need to add it to /etc/resolv.conf as described in 2. above.
 
Old 07-27-2010, 06:46 AM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Have you checked that your system has a valid ip address?
 
Old 07-27-2010, 09:58 AM   #7
Smophos
LQ Newbie
 
Registered: Jul 2010
Location: I call my home Leeds, England
Distribution: Ubuntu 10
Posts: 13

Original Poster
Rep: Reputation: 3
Thanks very much everybody who posted

It was just internal DNS, it's the jargon that confuses me sometimes


>>>>It works XD<<<<

Last edited by Smophos; 07-27-2010 at 10:09 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Problems adding windows machine to a Linux/Unix domain Mufasa Linux - Networking 4 05-28-2010 11:17 AM
Problems adding icons to Gnome in Ubuntu 7.10 V!NCENT Linux - Software 4 01-06-2008 07:49 AM
Problems adding Knoppix to Grub in Ubuntu Neo-Leper Linux - Distributions 4 07-25-2007 05:25 PM
how can i have mandrake le 2005 manual to read sararowana Linux - Newbie 3 06-06-2006 02:41 AM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 04:52 PM


All times are GMT -5. The time now is 04:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration