5

On my Ubuntu 12.4 these work fine:

$ hostname
my-machine-XX

ping `hostname`
ping my-machine-xx (192.168.0.69) icmp_req=1 ttk=64 time=0.043 ms

But host and nslookup return the wrong IP address:

$ host my-machine-xx
my-machine-xx has address 198.105.244.23
my-machine-xx has address 198.105.254.23
Host my-machine-xx not found: 3(NXDOMAIN)


$ nslookup my-machine-xx
Server:     127.0.0.1
Address:    127.0.0.1#53

Non-authoritative answer:
Name:   my-machine-xx
Address: 198.105.244.23
Name:   my-machine-xx
Address: 198.105.254.23

I'd appreciate help on how to fix it. Thanks.

Ya.
  • 249
  • 2
  • 6
  • 14
  • I'm not an expert, but I think the answer would be in finding out where each bit of information comes from. hostname may simply read the file /etc/hostname, but host or nslookup probably does a DNS lookup, which might be from an external source rather than your lan. I suspect your /etc/hosts file also has a big effect on the results. – Marty Fried May 25 '14 at 20:27
  • In case I didn't make it clear: my IP address is 192.168.0.69 and my hostname is correctl defined in /etc/hosts and hostname. Also the addresses reported by nslookup and host are nowhere to be found in /etc/hosts. – Ya. May 25 '14 at 21:35
  • Also, the reason I want to fix this - I believe this is what's preventing me from getting Oracle running on my box. Though unsupported, I was able to get everything linked up and configured and started the instance with no errors. However I can't connect even from my own box, with tnsping reporting the same retarded IP addresses as nslookup or host. – Ya. May 25 '14 at 21:45
  • Or maybe I didn't make myself clear. Some of these addresses and names can be "correctly" defined, but to the wrong setting. I can correctly set my hostname to google.com, but that doesn't make me Google, unfortunately. It depends on where you are looking from, whether inside your lan or outside. You have 2 IP addresses, not just one, so both can be correct, right? If you check your 192.x.x.x address from anywhere other than inside your lan, it won't work. Everyone can have that same address. – Marty Fried May 25 '14 at 21:47
  • If you are trying to access Oracle from your lan, forget about your external address, unless it's a static address, and your router doesn't block it coming in. I use dynamic DNS to access my server from outside, which is set to match my external IP. But that needs to be set up and maintained. – Marty Fried May 25 '14 at 21:51
  • I'm trying to connect from the same box where I'm running Oracle. – Ya. May 25 '14 at 22:05
  • Soo... according to what I've read - nslookup and host will always use DNS and DNS only, never looking at /etc/hosts. If so then - since I don't have a static IP - it seems like there is no way to do this. – Ya. May 25 '14 at 22:11
  • I don't think you should even be seeing your computer with those two commands. I have no idea how you can see it, but you probably should look on an Oracle help site for help with the specific problem. It might not even be related. – Marty Fried May 25 '14 at 22:26

3 Answers3

2

If you whois those IP's 198.105.240.0 - 198.105.255.255 is owned by Search Guide Inc. My ISP (Charter, US) uses a service of theirs to try and send me to a search page when a dns lookup results in a not found.

If I up a new machine using DHCP it'll get dns servers from my modem/router... by default the ISP's dns... which causes this to happen.

Using a DNS provider other than your ISP, Google is a good bet (8.8.8.8, 8.8.4.4), will get around this. At one time I found a page on Charter that allowed me to disable that 'feature', but I do not recall where that was.

brianj
  • 121
1

I have the same problem with an HP-UX system, NFS is not working, SAM does not want to launch and a few a other services are running slow or refuse to run. Although I don't know the solution yet, I bet if you go to any other computer (Linux, Windows, UNIX) that use the same DNS server and try to resolve any host name and end it with a dot (.) you'll get the same IP address (198.105.244.23).

dig anyhostname. dig nonsensehostname. host whatever. nslookup badhost.

In my case the IP addresses I get are slightly different than yours, but in the same subnet (198.105.244.24 and 198.105.254.24).

What can be deduced from this is that the problem is with the DNS server and not the local host. In my case DNS is served by an older Linksys router running DD-WRT build 14929, firmware "DD-WRT v24-sp2 (08/12/10) micro".

I will start using a different DNS server, perhaps one to the public Google DNS servers (8.8.8.8 and 8.8.4.4) and see how it goes.

Hope that helps you resolve your problem.

user301353
  • 11
  • 1
0

Make sure to look in your router's config for any NAT rules. My LAN use of the host command was giving two local IP addresses as part of the list of responses. (All others were public IPs.)

ip nat inside source static 192.168.1.68 www.xx.yyy.zz