473,772 Members | 2,388 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 #1
16 2308
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.
Nov 30 '05 #2
"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

Nov 30 '05 #3
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.

Nov 30 '05 #4

"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.


Nov 30 '05 #5
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.

Nov 30 '05 #6

"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?


Nov 30 '05 #7
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***** *************@n ewssvr13.news.p rodigy.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.

Nov 30 '05 #8
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:
: >
: > : "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?

Lookup "backtick operator" or "exec". (Both are linked from the manual
page for "system").

However, nslookup has the identical issue, if you lookup an ip that does
not have reverse data available then you won't get a name back, and etc.

Nov 30 '05 #9
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.
Nov 30 '05 #10

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

Similar topics

1
8797
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
19858
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
4011
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
2197
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
2796
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
9454
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
10264
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
10106
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...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7461
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6716
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
5355
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...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.