473,788 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Domain Name of curent user

Does someone have a reliable routine to get the domain name of the current
user of a web page? Something like NSLookup. I have no problem getting
their IP address, but I also want the domaine name.
Thanks,
-Michael
Nov 30 '05
16 2310
"Carl" <_Nospam_@_DO_N OT_.USE> wrote in message
news:kE******** ***********@new ssvr29.news.pro digy.net...
Michael wrote:
"Malcolm Dew-Jones" <yf***@vtn1.vic toria.tc.ca> wrote in message
news:43******** @news.victoria. tc.ca...
Michael (IN******@aol.c om) wrote:

: "Shane" <sh***@weasel.i s-a-geek.net> wrote in message
: news:pa******** *************** *****@weasel.is-a-geek.net...
: > On Wed, 30 Nov 2005 01:38:05 +0000, Michael wrote:
: >
: >> "Carl" <_Nospam_@_DO_N OT_.USE> wrote in message
: >> news:7d******** **********@news svr13.news.prod igy.com...
: >>> Michael wrote:
: >>>> Does someone have a reliable routine to get the domain name of the
: >>>> current user of a web page? Something like NSLookup. I have no
: >>>> problem
: >>>> getting their IP address, but I also want the domaine name.
: >>>> Thanks,
: >>>> -Michael
: >>>
: >>> how about:
: >>> http://www.php.net/manual/en/function.gethostbyaddr.php
: >>>
: >>> Carl.
: >>
: >> It may be just me, but that is the first think I tried and it gave
me an
: >> IP
: >> address not a domain name.
: >> Maybe it's the... "or a string containing the unmodified ip_address
on
: >> failure"... that is getting me.
: >> -Michael
: >
: > er you want to do a reverse dns lookup?
: > Thats fraught with issues.
: >
: > --
: > Hardware, n.: The parts of a computer system that can be kicked
: >
: > The best way to get the right answer on usenet is to post the wrong
one.
: >

: I'm not sure what you mean, when I type "NSLookup 70.98.111.52"
: at the command prompt I get back "Name: box52.bluehost. com"
: It works instantally and it works every time (that I have tried.)
: I want to get that same answer via PHP.

Try some other ips.

An ip does not need a name, (and can have many).

Even if it has a name, it does not need reverse lookup data.

Even when that data is available, the name you get from the reverse
lookup
is not necessarily the same name that anyone uses to access the host by
name. Indeed if you then lookup the name (i.e. you name you just got
from
the reverse lookup) then you may find it does not even resolve to the
same
ip you originally looked up.

As for the gethostbyaddr function, it appears to return the original
(input) address if it can't find a better name to go with it.

I am happy with the answer I get from NSlookup. But I am not familar
with getting results from system().
Can I use the system command to return the NSLookup result?


Are you actually running nslookup on the same physical machine that is
serving the failing php code?

I would suspect that somehow there is a configuration problem. Something
strange that they would show different results since the results should
actually be returned from the name server, not the function/program or
machine? Are both machines using the same dns server? Do both have access
to the internet?

Carl.


I have used NSLookup on many machines and haven't had any problems. But to
answer your question, no, I am only running the gethost on the server where
my web page is.
-Michael
Dec 1 '05 #11
"Carl" <_Nospam_@_DO_N OT_.USE> wrote in message
news:Vy******** **********@news svr29.news.prod igy.net...
Michael wrote:
"Shane" <sh***@weasel.i s-a-geek.net> wrote in message
news:pa******** *************** *****@weasel.is-a-geek.net...
On Wed, 30 Nov 2005 01:38:05 +0000, Michael wrote:
"Carl" <_Nospam_@_DO_N OT_.USE> wrote in message
news:7d**** **************@ newssvr13.news. prodigy.com...

>Michael wrote:
>
>>Does someone have a reliable routine to get the domain name of the
>>current user of a web page? Something like NSLookup. I have no
>>problem
>>getting their IP address, but I also want the domaine name.
>>Thanks,
>>-Michael
>
>how about:
>http://www.php.net/manual/en/function.gethostbyaddr.php
>
>Carl.

It may be just me, but that is the first think I tried and it gave me an
IP
address not a domain name.
Maybe it's the... "or a string containing the unmodified ip_address on
failure". .. that is getting me.
-Michael

er you want to do a reverse dns lookup?
Thats fraught with issues.

--
Hardware, n.: The parts of a computer system that can be kicked

The best way to get the right answer on usenet is to post the wrong one.

I'm not sure what you mean, when I type "NSLookup 70.98.111.52"
at the command prompt I get back "Name: box52.bluehost. com"
It works instantally and it works every time (that I have tried.)
I want to get that same answer via PHP.


FWIW, the statement < echo gethostbyaddr(" 70.98.111.52"); > prints
"box52.bluehost .com" for me.

I am not aware of any real reason that reverse dns lookups should be
considered "fraught with issues". You must keep in mind however that all
IP addresses do not have public dns records, and dns servers are often
'creatively' configured.

Carl.

It must be the way I am doing it then because I have had the same results on
three web hosts in three countries.
AsiaHost, OnlyWebHosting, and BlueHost.

Here is what I did....

$domain=gethost byaddr($REMOTE_ ADDR);
print "<p align=\"center\ ">$domain</p>\n";

I just tried a fixed IP of Microsoft $domain=GetHost ByAddr("207.46. 20.30");
and that didn't work either.

-Michael


Dec 1 '05 #12
"Carl" <_Nospam_@_DO_N OT_.USE> wrote in message
news:Vy******** **********@news svr29.news.prod igy.net...
Michael wrote:
"Shane" <sh***@weasel.i s-a-geek.net> wrote in message
news:pa******** *************** *****@weasel.is-a-geek.net...
On Wed, 30 Nov 2005 01:38:05 +0000, Michael wrote:
"Carl" <_Nospam_@_DO_N OT_.USE> wrote in message
news:7d**** **************@ newssvr13.news. prodigy.com...

>Michael wrote:
>
>>Does someone have a reliable routine to get the domain name of the
>>current user of a web page? Something like NSLookup. I have no
>>problem
>>getting their IP address, but I also want the domaine name.
>>Thanks,
>>-Michael
>
>how about:
>http://www.php.net/manual/en/function.gethostbyaddr.php
>
>Carl.

It may be just me, but that is the first think I tried and it gave me an
IP
address not a domain name.
Maybe it's the... "or a string containing the unmodified ip_address on
failure". .. that is getting me.
-Michael

er you want to do a reverse dns lookup?
Thats fraught with issues.

--
Hardware, n.: The parts of a computer system that can be kicked

The best way to get the right answer on usenet is to post the wrong one.

I'm not sure what you mean, when I type "NSLookup 70.98.111.52"
at the command prompt I get back "Name: box52.bluehost. com"
It works instantally and it works every time (that I have tried.)
I want to get that same answer via PHP.


FWIW, the statement < echo gethostbyaddr(" 70.98.111.52"); > prints
"box52.bluehost .com" for me.

I am not aware of any real reason that reverse dns lookups should be
considered "fraught with issues". You must keep in mind however that all
IP addresses do not have public dns records, and dns servers are often
'creatively' configured.

Carl.


You are not going to believe this...I wouldn't.
To give you the example I just sent, I FTPed back to my (home) computer that
php (from the host.)
I copied and pasted those two lines to the message.
Then I changed it to the fixed (microsoft) IP address.
I sent it back to the server and tested it.
When that didn't work, I cut and pasted the $REMOTE_ADDR back in.
NOW IT WORKS.
Too answer your (anticipated) question, no I don't use crack.
This really just happened.
-Michael

Dec 1 '05 #13
Michael (IN******@aol.c om) wrote:

: I just tried a fixed IP of Microsoft $domain=GetHost ByAddr("207.46. 20.30");
: and that didn't work either.

But it did work! It just didn't do what you wanted it to do. It returned
the information that was made visible to the host that ran the command -
in other words, no information.

That is exactly why someone originally said this was "fraught" with
problems.

You can only get the reverse lookup if an appropriate name server makes
that information available to you, and they commonly don't do that. Even
if the information is available to _some_ people on one network, _you_
will not be able to get it unless that name server is visible to you.
For example I have my own resolver setup at home, and I can assign names
to my machines, but my name server setup is not visible to you and so you
cannot get that information. Lots of machines have names that are only
visible to some internal network, even if the ip address of that machine
can access the world.

Dec 1 '05 #14
"Malcolm Dew-Jones" <yf***@vtn1.vic toria.tc.ca> wrote in message
news:43******** @news.victoria. tc.ca...
Michael (IN******@aol.c om) wrote:

: I just tried a fixed IP of Microsoft
$domain=GetHost ByAddr("207.46. 20.30");
: and that didn't work either.

But it did work! It just didn't do what you wanted it to do. It returned
the information that was made visible to the host that ran the command -
in other words, no information.

That is exactly why someone originally said this was "fraught" with
problems.

You can only get the reverse lookup if an appropriate name server makes
that information available to you, and they commonly don't do that. Even
if the information is available to _some_ people on one network, _you_
will not be able to get it unless that name server is visible to you.
For example I have my own resolver setup at home, and I can assign names
to my machines, but my name server setup is not visible to you and so you
cannot get that information. Lots of machines have names that are only
visible to some internal network, even if the ip address of that machine
can access the world.


I am not real savvy with all that, but are you telling me that I could see
the IP address of one of your (own resolver handled) machines but not the
dns name?

Did you see my post from 9:22 last night? Suddenly (with no change to my
php) it works 100% of the time (so far.)

Dec 2 '05 #15
Michael (IN******@aol.c om) wrote:
: "Malcolm Dew-Jones" <yf***@vtn1.vic toria.tc.ca> wrote in message
: news:43******** @news.victoria. tc.ca...
: > Michael (IN******@aol.c om) wrote:
: >
: > : I just tried a fixed IP of Microsoft
: > $domain=GetHost ByAddr("207.46. 20.30");
: > : and that didn't work either.
: >
: > But it did work! It just didn't do what you wanted it to do. It returned
: > the information that was made visible to the host that ran the command -
: > in other words, no information.
: >
: > That is exactly why someone originally said this was "fraught" with
: > problems.
: >
: > You can only get the reverse lookup if an appropriate name server makes
: > that information available to you, and they commonly don't do that. Even
: > if the information is available to _some_ people on one network, _you_
: > will not be able to get it unless that name server is visible to you.
: > For example I have my own resolver setup at home, and I can assign names
: > to my machines, but my name server setup is not visible to you and so you
: > cannot get that information. Lots of machines have names that are only
: > visible to some internal network, even if the ip address of that machine
: > can access the world.
: >

: I am not real savvy with all that, but are you telling me that I could see
: the IP address of one of your (own resolver handled) machines but not the
: dns name?

Yes.

Dec 2 '05 #16
"Malcolm Dew-Jones" <yf***@vtn1.vic toria.tc.ca> wrote in message
news:43******** @news.victoria. tc.ca...
Michael (IN******@aol.c om) wrote:
: "Malcolm Dew-Jones" <yf***@vtn1.vic toria.tc.ca> wrote in message
: news:43******** @news.victoria. tc.ca...
: > Michael (IN******@aol.c om) wrote:
: >
: > : I just tried a fixed IP of Microsoft
: > $domain=GetHost ByAddr("207.46. 20.30");
: > : and that didn't work either.
: >
: > But it did work! It just didn't do what you wanted it to do. It
returned
: > the information that was made visible to the host that ran the
command -
: > in other words, no information.
: >
: > That is exactly why someone originally said this was "fraught" with
: > problems.
: >
: > You can only get the reverse lookup if an appropriate name server
makes
: > that information available to you, and they commonly don't do that.
Even
: > if the information is available to _some_ people on one network, _you_
: > will not be able to get it unless that name server is visible to you.
: > For example I have my own resolver setup at home, and I can assign
names
: > to my machines, but my name server setup is not visible to you and so
you
: > cannot get that information. Lots of machines have names that are
only
: > visible to some internal network, even if the ip address of that
machine
: > can access the world.
: >

: I am not real savvy with all that, but are you telling me that I could
see
: the IP address of one of your (own resolver handled) machines but not
the
: dns name?

Yes.

What is the IP address, I will give it a try.
Dec 2 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8810
by: jach | last post by:
How can I get the domain, username and PC network name (Win 2000 Pro & Win XP Pro PC's) of the current logged on user (logged onto a domain and access an intranet page, Window 2000 server running IIS) and put this automatically in a textbox in an webpage. Can this be done with asp & VB? I basically want to automatically populate a username field with the users logon so the do not need to type it themselves, leading to type errors. ...
0
1478
by: Buddy Ackerman | last post by:
I have an application where the client wants AD integration. The application requires that the user accounts reside in the app's database. The application is a (.NET) webservices based app where the desktop client polls a webservice to return info to the user. The client wants to only manage accounts via the AD. So if they create a new AD user then the app should automatically create a user in the app database. This is not such a problem...
4
19862
by: Prehaut Anselme | last post by:
Hi, I need to create a WebRequest with an automatic proxy I have the specification of this porxy (host & port) I ask the user their own login and password, but the proxy tells me that the connection need an authentification. During the creation of a NetworkCredential you can define the login, the
4
3055
by: Zest4Csharp | last post by:
Hi there, When i use: WindowsIdentity.GetCurrent().Name.ToString(); I get a concatenated domain name and user name in the format : DOMAIN\USER_NAME. Are there functions in C# to get the domain name and user name separately? Cheers Zest
2
2501
by: Hrvoje Voda | last post by:
How to check if a user is logged into domain ? Hrcko
5
2755
by: Bruno Mendonça | last post by:
My boss asked me to build a program to create a report with logon/logoff events for all users within our windows domain. I'm using .Net to do so and decided to have a program running on the Domain Controler to listen to all new events and send them to a database. This last part I haven't worked on yet, cause I can't tell which events are relevant to write to the db and which are not. I have managed to listen to all the security log...
5
4012
by: Rocky | last post by:
Hi, I have a webform, with 2 textboxs and a submit button. In the text box1, i enter a username and in textbox2 I enter the computer name. Both the username and computer name is in active directory. When i click submit, I want to add the username from textbox1 into the local administrators group on the computer name from textbox2. I want to use vb.net as the programming language.
10
2198
by: Sridhar | last post by:
HI, I am having problems setting up a website so that it will be available only inside the domain. We have three servers. One is iis server and second one is internal server and the third one is sql server. I have deployed the web application in the internal server. It is not able to access the sql server that is on another server. If I deploy the same application on IIS, it is working fine. How should I set up the web application in the...
3
2797
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New DirectoryEntry("WinNT://us.ups.com") Dim DOMUSR As DirectoryEntry = DOM.Children.Find("USERID", "user") Dim LCLGRP As DirectoryEntry = LCL.Children.Find("LOCAL_GROUP", "group")
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.