LinuxQuestions.org
Help answer threads with 0 replies.
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-04-2014, 12:01 PM   #1
Rexlands
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Rep: Reputation: Disabled
Smile How to convert an IP address to a host name


I want to convert my IP address to a host name and add another network and configure it
 
Old 07-04-2014, 12:37 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Generally the -x flag to dig is used to look up the host name belonging to a particular IP, e.g.:

dig -x 123.234.231.100

Your second question is far too broad. What kind of network device do you want to configure?
 
1 members found this post helpful.
Old 07-04-2014, 12:41 PM   #3
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
not really sure what they are after but you can add a host name to the addresses in your /etc/hosts file.
 
1 members found this post helpful.
Old 07-04-2014, 01:19 PM   #4
Rexlands
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Smile Thanks guys

The first nic is been config to allow Internet user to link to the server and second nic is to intranet
 
Old 07-04-2014, 01:23 PM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
this worx for me:
Code:
   /sbin/ifconfig eth0 192.168.10.101 netmask 255.255.255.0 broadcast 192.168.10.255
   /sbin/iptables --flush            
   /sbin/iptables --table nat --flush
   /sbin/iptables --delete-chain     
   /sbin/iptables --table nat --delete-chain
   /sbin/iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
   /sbin/iptables --append FORWARD --in-interface eth0 -j ACCEPT
   /bin/echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/route add  -net 192.168.10.0  netmask 255.255.255.0 gw 192.168.1.1 dev eth0
obviousely you would have to modify it for your specific devices and addresses.

Last edited by schneidz; 07-04-2014 at 01:24 PM.
 
Old 07-04-2014, 02:57 PM   #6
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,877

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
The procedure for configuring a second NIC should be the same as configuring the first. The first NIC is eth0, the second is eth1, and so on.

I did searches for configuring single and multiple NICs and was led to the same Ubuntu documentation.

The Ubuntu documentation is here.

Last edited by bigrigdriver; 07-04-2014 at 03:17 PM.
 
Old 07-04-2014, 04:24 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,677

Rep: Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260Reputation: 2260
Some sort of hosts I'd think too.

If you have a normal lan computer group you can use a URL, hostname, or even a FQDN in an address line of a browser if you have one of a few ways to resolve it. One is hosts file. It has been used for decades. Two is some dns on the lan. Kind of rare for a home setup. Can go wild with lmhosts or other windows way.

This is still the basic rules (but use linux terms.)

"
Host name resolution generally uses the following sequence:

The client checks to see if the name queried is its own.

The client then searches a local Hosts file, a list of IP address and names stored on the local computer.


NOTE: The Hosts file location depends on the operating system:

Windows NT %Systemroot%\System32\Drivers\Etc
Windows 95 <drive>\<Windows folder>
Windows for Workgroups <drive>\<Windows folder>
Windows 3.1 <drive>\<Windows folder>
MS-Client 3.0 <Boot volume>\Net
Lan Manager 2.2c Client <Boot volume>\Net


Where %Systemroot% is the folder in which Windows NT is installed, <drive> is the drive on which the OS is installed, and <boot volume> refers to a boot floppy disk or drive C.

A sample hosts file, Hosts.sam, is installed with the TCP/IP protocol showing the proper format.

Domain Name System (DNS) servers are queried.

If the name is still not resolved, NetBIOS name resolution sequence is used as a backup. This order can be changed by configuring the NetBIOS node type of the client."

http://support.microsoft.com/kb/172218

Last edited by jefro; 07-04-2014 at 04:26 PM.
 
  


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
convert LAN IP address to Host Name when I give cmd tail -f /var/log/squid/access.log rs15 Linux - Networking 6 01-22-2012 02:45 AM
Convert guest logical address to host physical address hmd429 Linux - Virtualization and Cloud 1 10-07-2011 04:44 AM
Convert guest logical address to host physical address hmd429 Linux - Kernel 0 10-07-2011 03:35 AM
xdm error : Cannot convert Internet address to host name lovelinux Linux - Networking 2 06-01-2005 10:31 PM


All times are GMT -5. The time now is 02:54 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