Validation on Domain Name

Hi,
I need to do validation on domain name, There is a filed where user enters his domain address like WWW.DOMAIN.COM, If user dont enter proper domain name as mentioned it must return a message.
eg: it must only allow domain name only starting with name www. and end with some .com or .in or .net any thing which ends with . (period)
Need a suggestion how to validate this in plsql
Thanks
Sudhir

Check this if works for U
With t
as
SELECT 'WWW.DOMAIN.IN' txt from dual UNION ALL
SELECT 'WWW.DOMAIN..IN' txt from dual UNION ALL
SELECT 'WW.TEST.IN' txt from dual  UNION ALL
SELECT 'WWW.TEST.COM' txt from dual  UNION ALL
SELECT 'WWW.TEST.IN' txt from dual  
SELECT txt,
   CASE
      WHEN  REGEXP_LIKE ( txt
            , '^(WWW.)[A-Z]+(.COM|.IN|.NET)$'
      THEN  'Okay'
      ELSE  'Not Okay'
  END      AS is_correct_web_address
FROM t
TXT            IS_CORRECT_WEB_ADDRESS
WWW.DOMAIN.IN  Okay
WWW.DOMAIN..IN Not Okay
WW.TEST.IN     Not Okay
WWW.TEST.COM   Okay
WWW.TEST.IN    Okay
  For case in-sensitive
With t
as
SELECT 'WWW.DOMAIN.in' txt from dual UNION ALL
SELECT 'WWW.DOMAIN..IN' txt from dual UNION ALL
SELECT 'WW.TEST.IN' txt from dual  UNION ALL
SELECT 'WWW.TEST.IN' txt from dual  
SELECT txt,
   CASE
      WHEN  REGEXP_LIKE ( txt
            , '^(WWW.)[A-Z]+(.COM|.IN|.NET)$','i'
      THEN  'Okay'
      ELSE  'Not Okay'
  END      AS is_correct_web_address
FROM t 
TXT            IS_CORRECT_WEB_ADDRESS
WWW.DOMAIN.in  Okay
WWW.DOMAIN..IN Not Okay
WW.TEST.IN     Not Okay
WWW.TEST.IN    Okay
   Sudhir_Meru wrote:     
Thanks Kiran and loknath this worked for me. Thank you very much for you reply
>
Most welcome...That what forum is intended :-)
Edited by: Lokanath Giri on १९ अप्रैल, २०१२ ६:४८ अपराह्न

Similar Messages

  • Doubt abt validating the domain name

    Hi,
    I have a doubt in authenticating the domain name.
    Before the sendmessage can i verify whether the domain name's correct or not.
    for eg:[email protected] to verify whether test.com is valid or not.
    I'm using javax.mail to send mails in my application.
    I'm not getting how to do this and we dont have any DNS name.
    how do i authenticate this..plez help me in this.
    Thanx&Regards,
    Priya

    Before the sendmessage can i verify whether the domain
    name's correct or not.Not really, no.

  • Domain name in Email ID?

    Hello
    In my_form i have couple of email ID populating fields, i placed the adobe's email object text feilds, hence am getting a validation error popup, if user do not put either @ or a period, fine
    But, as this is used with in company and user always specifies company employee's official ID, hence i want to put a validation for DOMAIN NAME.
    The company's domain names looks like "domain1" or "domain2", email IDs looks like [email protected] or [email protected]
    User is SUPPOSE to enter ONLY either domain1 or domain2, if not, i need to alert!! (not like gmail, Yahooh email ID)
    1) Pls. let me know, is there in built feature (like Validation Pattern)?
    2) Any ready-made function? if so, pls. code snippet
    3) If not, pls. provide code snippet
    I am looking in JavaScript
    Thank you

    Validation Pattern should work. Something like this: text{O'@domain1.com'}|text{O'@domain2.com'}
    You can also use regular expression.

  • Valid windows username and domain name

    Hi,
    can anu one help me with regular expression of valid username and domain name for windows
    Abdul Khaliq

    figure out the rules and restrictions for those names, and it shouldn't be too hard to come up with a regular expression to describe those rules.
    Most likely it involves nothing more than checking for the length of the name and the existence of a small set of disallowed characters.

  • Domain name/"primary DNS" name/mail host name/mail server name/mx name

    Hi,
    I have registered my domain name (N.com) with an external dns server and created an MX record (mail.N.com) for it as well. My server sits behind a router and internet traffic is port(80)-forwarded to my server's fixed internal ip address (I can access my webpages from the internet just fine). When I initially setup the server I was asked to give it a "primary DNS name." I naturally assumed that N.com was supposed to be entered here, but that just caused all kinds of problems (though I still do not understand why). So I reinstalled and currently have server.N.com as the primary DNS name of the server (although it shows up in Server Admin and Workgroup Manager as server.local--why is that?)
    I have had no luck getting any email from the internet with the default settings in mail services (domain name of N.com and host name of server.N.com). Having no luck with the defaults, I assumed that maybe I needed to change the host name to "mail.N.com" so that it matched the MX record. I also changed the user preferences in Workgroup Manager to receive mail from mail.N.com--but still no luck. Could someone tell me what I am doing wrong and how come none of the Mail Service literature mentions anything about what a mail "host name" is supposed to be? Is it supposed to be the same as the "Mail Server" name that Workgroup Manager asks each user for? and is it the same as the MX record name?
    I am just needing some help to connect all these variously named, but undefined, dots.
    Also, how come I can access webmail from the internet using www.N.com/webmail but can't do it from any computers within my physical network (I have to use IPaddress/webmail or server.local/webmail)?
    Also, should my user email addresses be [email protected] or [email protected] (which is the current default)?
    Thanks in advance and good luck!
    John

    I had been told by a friend that ... regular email coming in from the internet would go through port 80
    Unfortunately you were misinformed.
    My MX record needs the extra subname (such as "mail") in front of the domain name, right?
    Not at all. A MX record for 'N.com' is entirely valid (expected, in fact).
    An MX record tells remote mail servers where to send mail for any domain/subdomain. If you think about it, let's say you worked for Apple and you wanted people to be able to send email to [email protected], well then you need an MX record for 'apple.com'.
    You can see if you dig MX apple.com that they actually have 9 MX records, but the point still stands.
    Now, you might also have MX records for subdomains so that you can have [email protected], [email protected], [email protected], etc. Each of these subdomains would need a separate MX record.
    So, in general, for any set of email addresses @[anything.]domain.com you have a MX record telling remote mail servers where to send that mail.
    Of course the MX record name is mail.N.com, but I think you are implying that the in the Mail settings of Server Admin where it asks for domain name all I need to put there is the N.com, right?
    What I mean is that you need to set the domain name to whatever domain name you expect to receive mail at.
    If you want users to have email addresses in the form of [email protected], then you enter 'N.com'.
    If you want users to have email addresses in the form of [email protected] then you enter 'mail.N.com'.
    If you want both forms, enter one in the main domain and add the other(s) in the Advanced -> Hosting -> Local Host Aliases section.
    Is there anything in the Mail settings that needs to have the full MX record name (mail.N.com)?
    Yes. Either the 'domain name' or the 'Local Host Aliases' needs to contain the same thing as your MX record. That's because the MX record tells remote servers to send mail to this machine, but the machine won't accept the mail unless it is configured to do so.
    What is the "host name" supposed to be?
    This should be the name that remote servers see when this machine tries to send outgoing mail.
    Ideally this should match the reverse DNS of your IP address, that way when it connects to a remote server it says "Hi, I'm $hostname" and the remote server can lookup the machine's IP address and see the same result. This will reduce the problem of remote servers thinking you're sending them spam.
    If you only have a single IP address then this probably needs to be something like 'N.com'. If you don't have control over your reverse DNS then you're going to run into a problem.
    Also in the user accounts (in Workgroup Manager) what should the "mail server name" be? Is it the host name or the domain name?
    Off hand, I don't know.
    Also, why are all the default user email addresses [email protected] (the name I gave the server at setup)? Why doesn't the user accounts create [email protected] as the default address?
    Presumably because the mail server says it is 'server.N.com' and therefore any accounts on that machine would be [email protected]. Changing the domain name (as above) should fix that.

  • Internal Domain names

    I know what a domain name is for the external web, but what forms of words are acceptable to OS X Server for an intranet? I don't want to have to pay to register a domain name acceptable to the rest of the web, I just want something meaningful for my intranet such as "diary" or "wiki" - or even an IP address alone.
    Do they all have to end in .local or will a single word be OK? Should they all start with http://www. or something else? OS X Server help just assumes any website being set up is for world use, and there are no instructions if you just want to set up a private intranet visible only to people on the internal network but invisible to the outside world.
    Where can I go for guidance/what formats are acceptable, please?
    Many thanks.

    Internal domains can be whatever you want. It doesn't have to be a .com, .net or even .local
    If you want you can have your own domain .bar then you can have foo.bar as a hostname in that domain.
    Since it's only used internally it won't have any impact on anyone outside of your network.
    Similarly, if you really wanted to, you could call your own domain 'apple.com' and then have a hostname of basilisk.apple.com pointing to your machine. Of course, this would impact your ability to get to any other .apple.com hostname, so you might not want to do that, but it is possible.
    As for the 'single word' question, by definition a hostname is a component of your domain which would mean that 'foo' isn't strictly valid, however, you can configure your machine (System Preferences -> Network -> TCP/IP -> Search Domains) to automatically append specific domain names to any lookup. If you set this to 'bar' then a lookup for 'foo' would automatically look up 'foo.bar' and you'd get the result you're looking for.
    Finally, for now, there is no requirement to have 'www' as pointing to your web server. That's just a common convention used around the internet. It's just as valid to have fred.bar as your web server and barney.bar as your mail server if that's what you want.

  • Domain name is blank on laserjet 200 color MFP m276

    I received this item today but I'm unable to add it to my home network.I've had no trouble previously with an HP 2610, 1102W, and 7520.
    On this network, a verizon DSL modem feeds  a Linux firewall,which provides routing/DNS/etc. to the computers on the net via several switches and a wireless access point.  Everything has a name in the form of "nicename.mynetworkname.net" and a static IPv4 address, and the firewall enforces the rules.
    I've tried to tell the control panel on the new laserjet everything I can manage to feed it.
    The new laserjet is connected to one of the switches by an ethernet cable.  The cable connectors on the printer and the main switch show orange lights, indicating no valid ethernet connection.  A printout of the Network Summary shows
    Status (wired) =Ready
    IPv4Address =192.168.nnn.mmm    (the value I gave it manually)  and an appropriate subnet mask and default gateway value.
    Network Identification shows
    Host Name =NPIDD2A25  (the value assigned by HP)
    but the Domain Name is blank.  I could not find a way to change it to mynetworkname.net.
    So the printer apparently thinks it's not on the net.  And computers on the net can discover the printer but can't use it.
    This setup has worked fine for previous printersthat worked by ethernet.  I don't see what I'm doing wrong here.
    Tips?
    ... Rich

    Hi KathFallston,
    I understand that you are unable to receive any faxes and everything passes on the fax test. I can
    help you.
    Check these settings for the fax:
    Go to the wrench icon/fax setup menu/advanced setup/private receive/turn it off.
    Go to the wrench icon/service /fax service/error correction/turn it off.
    Go to the wrench icon/fax setup /advanced setup/fax speed/change it to medium.
    Go to wrench icon/service menu/fax service/clear saved faxes.
    If you are still having issues, then follow this document.
    Cannot Send or Receive Faxes.
    What type of connection do you have? (Analogue, DSL, Cable Modem)
    Is there any voice mail set up?
    Do you have distinctive ring set up on the line?
    If you need further assistance, just let me know.
    Have a great weekend!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • This domain name can't be used because it contains a protected word or inappropriate language.

    Dear
    Creating a Microsoft services experience for my domain (fazlic.ba), is showing an error message as below:
    "This domain name can't be used because it contains a protected word or inappropriate language. Please contact support if you feel this is not the case."
    Can somone help in resolving this issue as i need this bit urgent and i am trying for same since last 2 days but with no success
    My domain name is fazlic.ba, which needs to be added as custom domain in domain.live.com
    Thanks

    Hi,
    we cannot provide any solution here because the domain validation is the second step of the process and is automated.
    My advice wouldbe to follow the message guideline and contact the support, they may identify why this domain is refused.
    Hope this helps,
    Fabrice DI GIULIO, http://blog.digiulio.fr
    Technical Solutions Professional, EMEA at AvePoint

  • Testing windows server 2012 R2 Essentials with a "diferent" Domain name.

    Hi, i've been testing the essentials version server and i've found some tips to change the Domain name at the setup install moment of the server.
    but, when i try to use a Domain name like this: Mylocaldomain.com.mx
    it allows me to use the .com name but doesn't allow me to use the .mx suffix.
    do you know if there is a way to workaround this detail? or it won't be permitted at all. ?
    thanks in advance!

    Hi,
    Based on my experience, an internal corporate namespace that used for internal purpose does not need to end in a valid top-level domain. That is to say you can use .ux as the top-level domain if you only use the domain on internal.
    In your configuration, com is the second-level domain and
    mx is the top-level domain. In general, com is a kind of the core group of generic top-level domains
    which indicates that this name has been registered to a business organization for commercial use. Maybe it is due to you cannot use
    com as the second-level domain and you can use another second-level domain instead of
    com to see if the issue persists.
    Best regards,
    Susie

  • Add a new directory with hyphen (-) in the domain name

    Dear All,
    I'm trying to add a new directory with hyphen (-) in the domain name (default domain *.onmicrosoft.com). As a result I keep getting a validation error: "The domain is not unique". I've tried several
    combinations with really awkward words and a hyphen. Such domain names must be unique. I think that the error message is misleading.
    Is it a well known behavior? Is it possible to use a hyphen in the domain name?
    Thank you for your help,
    Artem

    Dear Arvind,
    Thank you for your effort and time in validating the described behavior.
    According to the
    Regexp for subdomain question on SO, 'Each subdomain part may contain hyphens (dashes), but may not begin or end with a hyphen'. That been said, the validation error, on your screenshot is appropriate. On the other hand, the validation error
    with a hyphen (dash) in the middle is misleading.
    It's not a big deal, since people most likely use a custom DNS name anyway.
    Kind regards,
    Artem

  • Domain Name for Install

    I don't have a domain name on my laptop, only a workgroup name. Is it
    possible to install iAS without a domain name, and if not, can I make-up a
    domain name or how should I work around this issue? Thanks in advance!

    I mentioned this many times before. This is not the windows
    domain/workgroup. You do not need it for iAS to work.
    Domain means DNS, so you need to put something into for your DNS suffix.
    And yes, you can use any valid DNS type entry, like mydomain.com
    News wrote:
    >
    I don't have a domain name on my laptop, only a workgroup name. Is it
    possible to install iAS without a domain name, and if not, can I make-up a
    domain name or how should I work around this issue? Thanks in advance!--
    Han-Dat Luc ([email protected])
    Senior Consultant
    SUN Professional Services (iPlanet)
    o .
    o .
    O _ ____ _ _
    (_) _ \| | __ _ _ __ ___| |_ TM
    | | |_) | |/ _` | '_ \ / _ \ __|
    | | __/| | (_| | | | | __/ |_
    |_|_| |_|\__,_|_| |_|\___|\__|
    e-commerce solutions
    Sun Microsystems Australia Pty Ltd

  • Cisco ISE change Domain Name

    Our ISE deployment was setup with our internal domain name of csi.corp, when presenting the guest CWA this is the domain name the is presented to
    the guest.  We would like for this to be out public domain and a valid certificate.  From what I have gathered the web portal https certificate must contain the FQDN of the ISE node, therefore I would need to change the domain name on the server(s).  I have found posts that some have changed the domain name after deployment without any adverse results, is this possible?  We are currently integrated with our corp AD and able to utilize this the EAP authentications.  We have 2 nodes in our deployment, is it possible to change the domain name to our public domain without a rebuild?
    Thanks,
    Joe

    Hmm, unless something has changed I don't believe this would work because:
    - Even though the CN doesn't have to be an exact match of the FQDN, I believe that the domain suffix in the CN still must match the domain suffix in the FQDN. So you can have many different values and domains in the SAN fields but the domain in the CN field must match the domain specified in the FQDN. I don't have any certs to test this with now but I am pretty sure that even though the CSR generation would work, the process will fail when trying to import the cert. 
    - Is ".local.corp" a public domain? It doesn't sound like it but perhaps it is :) However, if it is not, then many public CAs won't issue you a public certificate for a private domain. You can definitely give it a try and see what they say :)
    Let me know what you find out!
    Thank you for rating helpful posts!

  • Ip address to fully qualified domain name

    Dear friends, I am unable to get the correct fully qualified domain name from IP address. Please help. I have already spent more than a day searching for the solution on these forums and on google. So now only option remaining is help from you friends.
    I think I need to explain my set up first.
    The machine runs on Solaris8 & is part of corporate intranet. Java version 1.4.2. I am just a developer (cannot touch networking) and here is what I know about its network set up.
    The machine has a network alias ("bluesky"). So when I access it thru telnet using VPN, the command line shows "bluesky" at the prompt. There are at least two domain names that lead to this machine. One is bluesky.XXX.com and another is somesubdomain.yyy.com.
    I have a piece of existing Java code that produces the IP number of this
    machine. I want to convert it to its domain name (either bluesky.xxx.com or the other one).
    When I connect by VPN to the network and use nslookup against the IP on my XP laptop, it displays the full domain (somesubdomain.yyy.com). When I do the same thing after I join the intranet directly (not thru VPN), it again shows the full domain, but the different one bluesky.xxx.com.
    Some of the code I tried:
    Try 1:
    String ip = "";//valid IP here
    InetAddress ia = InetAddress.getByName(ip);
    String hostname1 = ia.getCanonicalHostName();
    String hostname2 = ia.getHostName();When I connect to intranet (without VPN) and run the above code on my laptop, hostname1 and hostname2 both generate "bluesky.xxx.com". This is what I want.
    But when I run the code on the remote machine, both strings are only
    "bluesky". When I run the code on my laptop after logging into the network using VPN, both produce the second fully qualified domain name. That would also be OK for me if I can get it on remote machine.
    Try 2:
    I added the following line before the above code (based on forum search).
    System.setProperty("sun.net.spi.nameservice.provider.1", "dns,sun");The result was same as Try1.
    Try 3:
    InetAddress[] iaa = InetAddress.getAllByName(ip);
    for(int i=0;i<iaa.length;i++){
         System.out.println(iaa.getCanonicalHostName());
         System.out.println(iaa[i].getHostName());
    When ran on laptop, it iterates only once (I expected it to iterate twice) and produces bluesky.xxx.com for both println statements.
    On remote machine, it again produces only "bluesky".
    It's getting frustating. Please help. Thanks.

    Following could be the reason
    When you are running the InetAddress api's to get the domain name on your laptop (windows machine), It is not hitting the DNS server. It is just returning the domian name what is mention in the Laptop configuration. If you are making a security check based on that, then anyone can spoof up his domain name locally and get the desired domain.
    When you run the application at some remote machine, it actually resolves the ip address with DNS server.
    You may want to use the following code to hit DNS server all the time. But with this I have a issue. I am not able to get the domain when I am on VPN. I have to find the exact reason for this issue.
    private static String domainFmReverseDNS(String hostIp) throws IOException
    //Record opt = null;
    Resolver res = new ExtendedResolver();
    Name name = new Name(getReversedIP(hostIp)+ ".in-addr.arpa");
    short type = Type.PTR;
    short dclass = DClass.IN;
    Record rec = Record.newRecord(name, type, dclass);
    Message query = Message.newQuery(rec);
    Message response = res.send(query);
    Record[] answers = response.getSectionArray(Section.ANSWER);
    if (answers.length == 0)
    System.out.println("reverseDns did not find anything");
    return ("NotFound");
    else
    System.out.println("reverseDns found the value :-)");
    return answers[0].rdataToString();
    private static String getReversedIP(String ip)
    StringTokenizer st = new java.util.StringTokenizer(ip, ".");
    String reversedIp=st.nextToken();
    while ( st.hasMoreTokens())
    reversedIp = st.nextToken()+"."+reversedIp;
    return reversedIp;
    }

  • Problem connecting through RFC with fully qualified domain name

    I am using the .NET Connector and RFC to call a BAPI
    I use a fully qualified domain name in the form <DOMAIN>\<HOST>
    The RFC seems to have problems with this form of address. It produces the following execption in my .NET code.
    SAP.Connector.RfcCommunicationException: Connect to SAP gateway failed
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname 'DOCUNET_AG\DWSAP' unknown
    TIME        Mon Feb 05 11:57:20 2007
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        329
    DETAIL      NiPGetHostByName2: hostname 'DOCUNET_AG\DWSAP' not found
    SYSTEM CALL gethostbyname_r
    ERRNO       11004
    ERRNO TEXT  WSANO_DATA: Valid name,
       at SAP.Connector.SAPConnection.ThrowRfcException(RFC_ERROR_INFO_EX rfcerrInfo
    , Encoding encoding, String languangeCode)
       at SAP.Connector.SAPConnection.Open()
    What can I do that I am able to use a fully qualifies domain name in this way?
    Thank you very much for your answers.
    Mirco

    Hi Mirco,
    additional to my first reply, open a shell window and type
    <b>
    ping <computername>
    </b>
    or
    <b>
    ping -a <ipaddress>
    </b>
    so you should get the full qualified name for the host.
    Regards
    Holger

  • Illegal host/domain name found

    Hi, i hit some error when reply mail to a mail account which is valid:
    16-Mar-2006 16:11:26.98 tcp_local R 104 [email protected] rfc822;[email protected] [email protected] Illegal host/domain name found (TCP active open: Failed gethostbyname() on misty.sgx.com.my, resolver errno = 1)
    from nslookup:
    santomas.com.myServer: ns1.jaring.my
    Address: 161.142.201.17
    Non-authoritative answer:
    Name: santomas.com.my
    Address: 202.189.48.236
    I'm not an expert on DNS, what cause this error? This domain with the account is valid.
    Will "nomx" keyword put in under tcp_local in imta.cnf will solve ?

    also:
    set type=mx
    santomas.com.myServer: ns1.jaring.my
    Address: 161.142.201.17
    santomas.com.my preference = 20, mail exchanger = meia.sgx.com.my
    santomas.com.my preference = 30, mail exchanger = misty.sgx.com.my
    santomas.com.my nameserver = ns1.nameserversecure.com
    santomas.com.my nameserver = ns2.nameserversecure.com
    ns1.nameserversecure.com internet address = 202.189.48.238
    ns2.nameserversecure.com internet address = 202.189.48.239
    there is not "nomx" keyword under tcp_local or default.....
    Messaging Server 6.2

Maybe you are looking for

  • Keep losing my wi-fi connection when I plug my macbook into my tv.

    I just recently started plugging my macbook into my tv to use it as a dual display. Once I plug in, my wi-fi connection just disappears, and I can't seem to connect to anything. When I plug back out it's back to normal. Does anyone know what's going

  • Using FINDER - Organise photos in ascending chronological order

    In windows you can put your photos in filename order, date created, modified etc the same as Finder, however I cannot find how to choose to put photos in ascending chronological date order. When you choose Date created it organises them backwards fro

  • Can't get sound through my big speakers

    Hello all, I just hooked up my new Apple TV and all works fine BUT can't get any sound through my big floor speakers, only through the tinny TV speaker (Samsung 46" LED). The big speakers are powered by an older Onkyo FM AM receiver with no optical d

  • File with an Attachment to Mail with an Attachment

    I'm using File adapter and using additional Files option to attach another attachment. I have to send mail out using Mail receiver adapter and should use same attachment name File adapter picked up. I tried several options using MessageTransformBean,

  • Mail on Mobile Me: How do you move  and promote folders?

    I have a couple of folders that are inside others. I want to promote the 2ndary folders to primary. How?