cancel
Showing results for 
Search instead for 
Did you mean: 

127.0.0.1 IP resolution to 'localhost' problem

Former Member
0 Kudos

Hello,

Environment:

Windows Server 2008 Standard Edition

MS SQL Server 2008 SP1

SAP Solution Manager 7.0 EhP1

IPv4 is being used and NO loopback adapter is installed.

Considering Hostname of local computer: ld8060 (NiMyHostName)

My 'hosts' file entry:

-


10.66.66.90 ld8060 ld8060.wdf.sap.corp

127.0.0.1 localhost

-


Output of 'niping -v' command is:

-


Lookup of hostname: ld8060 (NiHostToAddr)

--> IP-Addr.: 10.66.66.90

Lookup of IP-Addr.: 10.66.66.90 (NiAddrToHost)

--> Hostname: ld8060

Lookup of hostname: localhost

--> IP-Addr.: 127.0.0.1

Lookup of IP-Addr.: 127.0.0.1

--> Hostname: ld8060

-


Problem is with the last entry where 127.0.0.1 resolves to the computer name 'ld8060' instead of 'localhost'

Because of such ambiguous IP resolution SAP is not getting started.

Please help.

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi again, Kashyap!

Well, I guess that you are referring to your post of last October the 8th on the output of the command 'niping -v', isn't it?

Lookup of IP-Addr.: 127.0.0.1

--> Hostname: ld8060

You are still wondering why 127.0.0.1 is resolved to 'ld8060' instead of 'localhost'. Regarding this, it depends on the system call being used: if NiAddrToHost is called, you should be returned 'localhost', but if NiAddrToHostCanon is called, your hostname will be shown.

However, the important point here is, as described in Anil's referred [note 1054467|https://service.sap.com/sap/support/notes/1054467], that the resolution for your local host name (done whether by your DNS or the computer local service) is the IP address of your NIC, and not a loopback address (127.0.0.1, 127.0.0.1/8 or ::1).

You will surely find very interesting for this and future questions the PDF document "Network Integration" attached to [note 21151|https://service.sap.com/sap/support/notes/21151]. Regarding more general TCP/IP questions on your Windows operating system, please refer e.g. to the Microsoft Technet's [TCP/IP Fundamentals for Windows|http://technet.microsoft.com/en-us/library/bb727005.aspx].

Cheers!

Former Member
0 Kudos

Hello All,

SAP has confirmed that this is the normal network behavior and there is no problem with it.

Thanks all of you for your contribution.

Best Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Answers (10)

Answers (10)

Former Member
0 Kudos

Hi again, Kashyap!

Well, I guess that you are referring to your post of last October the 8th on the output of the command 'niping -v', isn't it?

Lookup of IP-Addr.: 127.0.0.1

--> Hostname: ld8060

You are still wondering why 127.0.0.1 is resolved to 'ld8060' instead of 'localhost'.

Regarding this, it depends on the system call being used: if NiAddrToHost is called, you should be returned 'localhost', but if NiAddrToHostCanon is called, your hostname will be shown.

However, the important point here is, as described in Anil's referred [note 1054467|https://service.sap.com/sap/support/notes/1054467], that the resolution for your local host name (done whether by your DNS or the computer local service) is the IP address of your NIC, and not a loopback address (127.0.0.1, 127.0.0.1/8 or ::1).

You will surely find very interesting for this and future questions the PDF document "Network Integration" attached to [note 21151|https://service.sap.com/sap/support/notes/21151]. Regarding more general TCP/IP questions on your Windows operating system, please refer e.g. to the Microsoft Technet's [TCP/IP Fundamentals for Windows|http://technet.microsoft.com/en-us/library/bb727005.aspx].

Cheers!

Former Member
0 Kudos

Hi again, Kashyap!

And in the same "ipconfig /displaydns", what are the records returned for "localhost" ?

By the way, do you get in the dispatcher developer trace ( dev_disp ) the entries described in Anil's mentioned [note 1054467|https://service.sap.com/sap/support/notes/1054467]? These would be e.g.:


*** DP_FATAL_ERROR => DpMsAttach: local hostname 'xxx' is resolved to loopback address
*** DISPATCHER EMERGENCY SHUTDOWN ***

By the way, don't you punctuate our answers? It would motivate us and maybe even new participants!

Cheers!

Former Member
0 Kudos

The output for localhost is:

localhost

-


Record Name . . . . . : localhost

Record Type . . . . . : 1

Time To Live . . . . : 86400

Data Length . . . . . : 4

Section . . . . . . . : Answer

A (Host) Record . . . : 127.0.0.1

localhost

-


No records of type AAAA

I understand your curiosity but I see 3 options to punctuate, helpful / very helpful / solved, when it is none of them shall I still go ahead and mark. Wouldn't it be wrong on my part ?!

Please let me know if I shall still do that.

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Just one more thing here.

My SAP system is starting properly.

I am just looking for an answer to this confusion: output of 'niping -v' because as per my understanding hostname -> IP -> hostname resolution must be unique.

Whereas in my case it is:

localhost -> 127.0.0.1 -> <computer_name>

Thanks & Rehards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Hi Kashyap!

Maybe you could check the command "ipconfig /displaydns"; it would be interesting to check what does the cache show for the record "1.0.0.127.in-addr.arpa" (this is the inverse resolution for 127.0.0.1).

Cheers!

Former Member
0 Kudos

Output of ipconfig / displaydns for 1.0.0.127:

1.0.0.127.in-addr.arpa

-


Record Name . . . . . : 1.0.0.127.in-addr.arpa.

Record Type . . . . . : 12

Time To Live . . . . : 86400

Data Length . . . . . : 8

Section . . . . . . . : Answer

PTR Record . . . . . : localhost

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Hi Heitbrock!

I agree that it is better to configure a DNS; I was simply assuming that in this case it is not possible for some reason, but it is always good to question the way things are being done.

Regarding the "ipconfig /flushdns", it is used to flush and reset the contents of the DNS client resolver cache in order to discard negative cache entries without the need to reboot the server; however, you can reboot the server instead.

Cheers!

Former Member
0 Kudos

Hi,

why do you use the hosts file? Normally you should get all infos from a DNS server. I never would use the hosts file because it could be different from client to client and you have no possibilites to make sure everyone has the same hosts file. Also when you change the IP from the server the hosts file won't be changed until you do that.

If there aren't any special reason for that i would uncomment all hosts entries as it is by default and use DNS instead.

BTW: the command "ipconfig /flushdns" won't help you i think

Edit:

Try to work with the FQDN/DNS-name "ld8060.wdf.sap.corp"

If you do an "nslookup ld8060.wdf.sap.corp" it should bring back the IP 10.66.66.90

If you then use that in your connection settings then you should be able to connect to that IP.

Hope to understand you right that was the point you wanted to do.

Edited by: Heitbrock Denis on Oct 18, 2010 5:01 PM

Former Member
0 Kudos

Jesus,

I have tried manipulating hosts file in every possible way but not luck.

Denis,

There is no DNS in client's infrastructure so I HAVE to use hosts file.

The problem is only with the IP 127.0.0.1 not resolving to localhost but actual hostname/computer name.

Thanks & regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Hi !

Why don't you try inverting the order; I mean, leaving the very 1st row being the localhost one, and then the rest?

The order is important in hosts file. Remember to flush the DNS before trying again!

Good luck!

saif_sabri
Active Participant
0 Kudos

Hi

Hotfix Download Available

[http://support.microsoft.com/kb/978309]

Regards from Pakistan

Former Member
0 Kudos

Anil,

Thanks but I had already referred mentioned SAP Note without much use.

Saif,

Our version of Windows is just server 2008 and not R2 and moreover we are using IPv4 and not IPv6.

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

markus_doehr2
Active Contributor
0 Kudos

> My 'hosts' file entry:

> -


> 10.66.66.90 ld8060 ld8060.wdf.sap.corp

> 127.0.0.1 localhost

> -


I would create a second row for the domain alias, Windows is not smart enough to take "both" in a row.

I would also put "localhost" as the first entry.

Then execute

ipconfig /flushdns

and try again..

Markus

Former Member
0 Kudos

Markus,

Tried doing what you said but no luck.

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Hi,

Posting us the above mentionedd log files may help us guide u.

-Varadhu...

Former Member
0 Kudos

Thanks all for your inputs.

My SAP system is now starting. There has been some strange problem noticed, when it is started first time through MMC all instances/components(SCS,CI,etc.) do not start and on subsequent start/restart everything starts up.

But I am still wondering why the output of niping -v is so and would really appreciate an answer.

As this is something very basic, when localhost is resolving to 127.0.0.1, why not the other way !!

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Hi,

I guess, 127.0.0.1 localhost is the first entry in "hosts" file...

If so, just shift the entry of "localhost" at the bottom of the file (last entry)...

Then just repair Local Area Connection or use then following command to flush the dns cache...

C:\ipconfig /flushdns

Then check the result...

Hope, it works for you also...

Regards.

Rajesh Narkhede

Former Member
0 Kudos

Alreay tried putting localhost entry at the begining, end, completely removing the localhost entry from hosts file.

Rebooting windows after every change.

Nothing helps.

I checked on other windows server and strangely the same problem so now I am wondering whether it shall be categorized as a problem or not !!

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

Hi,

I checked on other windows server and strangely the same problem so now I am wondering whether it shall be categorized as a problem or not !!

Yes it is not a strange issue and the same was mentioed already in the other post.

This is not strange but normal behavior and I guess the issue might be somewhere else.

-Varadhu...

former_member227283
Active Contributor
0 Kudos

Dear Kashyap,

Pls refer to SAP note :- Note 1054467 - Local host name refers to loopback address

It should clear your doubt of localhost resolution.

Thanks

Anil

Former Member
0 Kudos

Hi,

This is not strange but normal behavior and I guess the issue might be somewhere else. Post us the dev_disp log.

Try executing R3trans -d and post us the trans.log also.

Regards,

Varadharajan M

Former Member
0 Kudos

Can you please paste the error logs from SAP start and dev_w0, dev_disp

Former Member
0 Kudos

Right now I do not have system access so as soon as I get it I'll update the message with logs.

Another surprising finding, I completely removed '127.0.0.1 localhost' entry from hosts file still the output of 'niping -v' command is same !!

But now when I try starting SAP system, at first attempt it fails. After which when I restart SAP system it starts !!

Little lost here but I need to understand this localhost issue anyways.

Thanks & Regards,

Kashyap Shah

SAP Technology Consultant

Cell: +91 9819815655

Former Member
0 Kudos

When I checked my server, I also got the same results as you which mean there is no issue with localhost. There is another issue which causing SAP to fail to start. I think when you get access to the logs then this will clear.