Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

extracting the domain name

 
   Web Hosting and Web Master Forums (Home) -> Webmaster RSS
Related Topics:
Domain Names for $9..75 - Available at Features for customers • Easy to use web-based control panel. • Full control over contact details • FREE domain locking (prevent your domain from being • Full of..

sub domain - Hello all. I'm trying to make it possible for someone to visit my web site if they enter instead of I talked to my host and they already set it up in their DNS and they told me that I should..

Help on Domain Name - Which one would be the better name for a Domain Name, long or short. eg: or AUSC.com and why? Regards Form a beginner who is learning heaps from your guys! Thanks KJ

domain names - Looking for some advice... I want to set up a website for people in trading - or selling hostas .... Most likely by a script and maybe an auction script - most likely with no charge to users. I want a domain..

Can I do this with the domain url? - Hi, I already have a site up and running with my business named as say, The dns name servers are the Host1's name, NOT this one, or one of mine. I now have found another host (Host2) who I want to use and they say I can use my..
Next:  Webmaster: Is anyone _generating_ an RSS feed? (maybe John Bokma)  
Author Message
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 1) Posted: Tue Jul 12, 2005 12:55 pm
Post subject: extracting the domain name
Archived from groups: alt>www>webmaster (more info?)

Greetings One and All

Been pondering domain names.

Do you have an algo (that you don't mind sharing) that can pull the domain
name from any of the likely strings (host/server name or URL) available to
the (web) server?

Either linear rule string manipulation or regular expression would suit
just fine.

Thanks for reading.
--
William Tasso

** Business as usual

 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
Ignoramus31199

External


Since: Jul 12, 2005
Posts: 6



(Msg. 2) Posted: Tue Jul 12, 2005 12:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

This message is not archived

 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 3) Posted: Tue Jul 12, 2005 1:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Writing in news:alt.www.webmaster
From the safety of the cafeteria
Ignoramus31199 <ignoramus31199.RemoveThis@NOSPAM.31199.invalid> said:

> ...
>
> $cgi->virtual_host ();

thanks - I can get the hostname, it's the domain name I'm after.

--
William Tasso

** Business as usual
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
Ignoramus31199

External


Since: Jul 12, 2005
Posts: 6



(Msg. 4) Posted: Tue Jul 12, 2005 1:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
comments

External


Since: Sep 14, 2004
Posts: 1625



(Msg. 5) Posted: Tue Jul 12, 2005 1:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Once upon a time, far far away "William Tasso"
<SpamBlocked RemoveThis @tbdata.com> muttered

>Greetings One and All

And pop-pickers?

>
>Been pondering domain names.

Everyone needs a hobby....

>
>Do you have an algo (that you don't mind sharing) that can pull the domain
>name from any of the likely strings (host/server name or URL) available to
>the (web) server?
>
>Either linear rule string manipulation or regular expression would suit
>just fine.
>

Can you be a bit more explicit.

>Thanks for reading.

That's okay. The invoice is in the post.
>--
>William Tasso

Matt Probert

>
>** Business as usual

Same as always
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
gandalf

External


Since: Mar 27, 2004
Posts: 162



(Msg. 6) Posted: Tue Jul 12, 2005 1:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"William Tasso" <SpamBlocked DeleteThis @tbdata.com> wrote in news:op.sts6nqcvm9g4qz-
wnt DeleteThis @tbdata.com:

>>
>> $cgi->virtual_host ();
>
> thanks - I can get the hostname, it's the domain name I'm after.

Oh you mean you just want to extract the part that would be used for
emailing? Like setting a spider to gather possible email addresses?

I think thats been done quite abit but not openly released for obvious
reasons

Gandalf Parker
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 7) Posted: Tue Jul 12, 2005 2:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Writing in news:alt.www.webmaster
From the safety of the cafeteria
Ignoramus31199 <ignoramus31199 RemoveThis @NOSPAM.31199.invalid> said:


> ...
> you mean, say the hostname is www1.domain.com, you want to extract
> domain.com?
>
> I would do a "split", and then "pop" the last two items. It is good
> except for countries where domains are like domain.co.uk. perhaps if
> the second pop is a 'co' or some such, you could pop one more item.

Yes - that is exactly the issue, consider these hosts ...

www.example.com
example.com
office.example.com
admin.office.example.com

www.example.co.uk
etc...

www.example.uk.net
etc...

--
William Tasso

** Business as usual
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 8) Posted: Tue Jul 12, 2005 2:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Writing in news:alt.www.webmaster
From the safety of the GreyWyvern.com cafeteria
GreyWyvern <spam.DeleteThis@greywyvern.com> said:

> And lo, Matt Probert didst speak in alt.www.webmaster:
>
>> Once upon a time, far far away "William Tasso"
>> <SpamBlocked.DeleteThis@tbdata.com> muttered
>>
>>> Either linear rule string manipulation or regular expression would suit
>>> just fine.
>>
>> Can you be a bit more explicit.
>
> William is explicit enough without you asking him to be more so! Razz
> Next thing you know you'll be asking him to take off that Speedo of
> his...

Ugh - as always, the invitation will be politely refused.

--
William Tasso

** Business as usual
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 9) Posted: Tue Jul 12, 2005 2:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Writing in news:alt.www.webmaster
From the safety of the cafeteria
Gandalf Parker <gandalf DeleteThis @most.of.my.favorite.sites> said:

> "William Tasso" <SpamBlocked DeleteThis @tbdata.com> wrote in news:op.sts6nqcvm9g4qz-
> wnt DeleteThis @tbdata.com:
>
>>>
>>> $cgi->virtual_host ();
>>
>> thanks - I can get the hostname, it's the domain name I'm after.
>
> Oh you mean you just want to extract the part that would be used for
> emailing?

well not really

sales DeleteThis @example.com
and
sales DeleteThis @office.example.com

may both be valid mail addresses. I'm only interested in the domain.

> Like setting a spider to gather possible email addresses?

Heh he - no need these hosts/domains already sit nicely on my servers.
I'm writing a generic component that incidentally needs to know the domain
name regadless of hostname.

> I think thats been done quite abit but not openly released for obvious
> reasons

except that in the case of mail spiders there is no incentive to get it
right.

--
William Tasso

** Business as usual
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
Ignoramus31199

External


Since: Jul 12, 2005
Posts: 6



(Msg. 10) Posted: Tue Jul 12, 2005 3:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Imported from groups: per prev. post (more info?)

Back to top
Login to vote
spamblocked1

External


Since: Sep 19, 2003
Posts: 3499



(Msg. 11) Posted: Tue Jul 12, 2005 7:55 pm
Post subject: Re: extracting the domain name [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Writing in news:alt.www.webmaster
From the safety of the Castle Amber - software development cafeteria
John Bokma <john.TakeThisOut@castleamber.com> said:


> ...
> for ( $domain ) {
>
> # remove sub domain
> s/www?\d?\.([^\.]+\.)/$1/g; # common ww(w)(\d) prefix
> s/.+\.([^\.]+\.[a-z]{3})$/$1/g;
> s/.+\.([^\.]+\.[^\.]+\.[a-z]{2})$/$1/g;
> }

thanks, but ...

> is what I used for a project. Note: it's far from perfect Very Happy.

yes, having thought on it some more I'm coming to the conclusion it cannot
be done purely with logic.

As these domains are all known to me I think I'll have to do a match
against a data store - splitting the hostname and starting at the back,
adding elements till I find a match.

Really can't think of anything else that is guaranteed to work (for an
acceptable value of 'work')

--
William Tasso

** Business as usual
 >> Stay informed about: extracting the domain name 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Webmaster All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]