LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 04-14-2011, 03:28 PM   #1
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Rep: Reputation: 0
assign hostname


I've installed a new copy of Ubuntu 10.10.Now the big question for me is how do we assign hostname to a given ip?

I've given the hostname during the server installation and "cat hosts" says "ebox" hostname I'm trying to put on.Also,I modified the network/interfaces to static and assigned proper values.

#hostname returns ipaddr not the hostname. Also nslookup hostname/ipaddr says server can't find ....

So,is installing dns through bind and setting-up the only way to do that?

Any suggestions?

Thanks
 
Old 04-14-2011, 03:33 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
To which IP?
You can add in /etc/hosts
Code:
127.0.0.1	localhost
10.0.0.44	ebox
Kind regards
 
Old 04-14-2011, 03:36 PM   #3
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
I've an entry in /etc/hosts

like

127.0.0.1 localhost
127.0.1.1 ebox.mydomain.com ebox

do I replace 127.0.1.1 ebox.mydomain.com ebox with 10.0.0.44 ebox.mydomain.com ebox

Thanks

Last edited by ansrewdps; 04-14-2011 at 03:37 PM. Reason: error
 
Old 04-14-2011, 03:38 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
do I replace 10.0.0.44 ebox.mydomain.com ebox with 127.0.1.1 ebox.mydomain.com ebox
Code:
127.0.1.1 ebox.mydomain.com ebox
replace 127.0.1.1 with the ip from your server.

Kind regards
 
Old 04-14-2011, 03:55 PM   #5
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
#hostname now returns "ebox" but nslookup still says "server can't find ebox".

What could be the problem

regards
 
Old 04-14-2011, 04:02 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Did you configured a DNS entry for ebox?
What do you want to achieve?
If you use
Code:
ping ebox
it should give you the correct IP

Kind regards
 
Old 04-14-2011, 04:18 PM   #7
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
to my knowledge I'm sure of the dns entries in resolv.conf


ping ebox from outside hosts says unknown host;ping ebox from localmachine gives the correct ipaddr and finally ping ipaddr reply back too

Regards


Andrew
 
Old 04-14-2011, 04:21 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
ping ebox from outside hosts
Do you mean from inside your LAN?
Just add the ip and name in /etc/resolv.conf
from the outside host.
If you mean from outside the network, via the internet, you need to register your domain, and create a DNS entry.

/etc/resolv.conf is not DNS, ping etc first look in this file, if they find it, they will use it, else they will use global DNS

Kind regards

Last edited by repo; 04-14-2011 at 04:24 PM.
 
Old 04-14-2011, 04:31 PM   #9
ansrewdps
Member
 
Registered: Dec 2010
Posts: 56

Original Poster
Rep: Reputation: 0
I'm sorry but is it just "nameserver ip" (or) "ebox ip" in the other /etc/resolv.conf. And when I mean hosts,it means any terminal in the network,via the internet. Sorry if this confused you. Domain is already registered and has a DNS entry
 
Old 04-14-2011, 04:38 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
I'm sorry but is it just "nameserver ip" (or) "ebox ip" in the other /etc/resolv.conf.
The same entry as in the resolv.conf on the server.
Quote:
Domain is already registered and has a DNS entry
If the domain is registered, and the dns entry is made, then your server has a public ip, right?
If not, the name will resolve to the public ip from the router.
If you want to use nslookup, you need to give the whole domainname mydomain.com
If this doesn't work, it's possible DNS isn't propagated yet.

Kind regards
 
  


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
FC13 install can ping by hostname, ssh by hostname fails jeffk42 Linux - Networking 4 11-14-2011 12:27 PM
Is it possible to ask DHCP assign a randomize hostname to client? Reaperhk Linux - Server 1 11-20-2009 09:53 PM
Changed hostname during install, now CUPS has wrong hostname on web interface slinx Linux - Software 1 08-07-2009 09:01 PM
Assign Static Hostname in Ubuntu Server deibertine Linux - Newbie 3 08-05-2009 05:01 PM
after hostname change, syslogd still output previous hostname to messages file tiger2000 Linux - General 3 07-22-2009 10:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:34 PM.

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