Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Hostname /IP address in Linux

Posted on 2014-03-03
6
Medium Priority
?
395 Views
Last Modified: 2014-03-18
I have ubuntu server. The network interfaces is set up for DHCP
when I run Ifconfig, I see the interface gets IP 172.16.27.193 as shown in the screenshot
however when I run nslookup hostname, the Ip address is 172.16.27.20

I am not sure why those 2 IPs are different:
172.16.27.193 and 172.16.27.20

Thanks:

ipipip
0
Comment
Question by:jskfan
6 Comments
 

Author Comment

by:jskfan
ID: 39902203
ip
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 500 total points
ID: 39902269
DHCP and DNS are two difference services, which may or may not be linked.

In your case, your DNS is giving you incorrect information, so you need to find out more about how DNS is configured in your network and how it is controlled.
0
 
LVL 18

Assisted Solution

by:TobiasHolm
TobiasHolm earned 500 total points
ID: 39902416
What Tintin says is true. Also, your reverse lookup isn't working (in-addr.arpa).

A tip is to try and use FQDN while troubleshooting, example: ubuntu.mydomain.com unstead of just ubuntu.

A good tool when troubleshooting DNS are "dig".  And also the tool "nslookup".
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Assisted Solution

by:Sandy
Sandy earned 500 total points
ID: 39902571
Check with Reverse DNS entries in your nameserver to understand why these 2 IP's are showing two different names. Whether nslookup or dig -x both will try to query to in-addr.arpa withing RDNS so i suggest below action plan.

1. Check and configure reverse dns in your network.
2. Configure your ubuntu box with that dns address in /etc/resolv.conf
3. Then try to test by using #nslookup <ip> or #dig -x <ip>

TY/SA
0
 
LVL 27

Accepted Solution

by:
skullnobrains earned 500 total points
ID: 39912179
you are asking the dns server at 172.16.27.2 to answer to a dns query for ubuntu.X where X is whatever is configured in the "search" line of your /etc/resolv.conf

if you expect dns and dhcp to be linked, you'd probably should use  single server for both. what is your dhcp software ? is it on the same host as the dns server ?

you probably should try and give a name that is a little more unique than ubuntu to your machine if you expect to debug anything
0
 

Author Closing Comment

by:jskfan
ID: 39937724
I will check it later…Thank you Guys!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question