Powershell : Checking DNS alias

Hi,
We have 2 servers, one production and one back-up. With a DNS alias everyone connects to the production server. When the backup server becomes operational we just need to change the DNS alias.
Now, I need a script for checking this DNS alias value.
When the DNS alias match with server A, then is this the production server and it must start some services again after a reboot. For server B is not allowed to start some services after reboot because he is the backup server.  The necessary services
on both servers will be set on manually. When server B becomes the operational server, we change the DNS alias to server B and reboot both servers. Afterwards the services on server B will start and on server A don't.
Thanks!

Hi,
Here's a simple way you can test this:
$alias = 'CNAME'
$IP = (Test-Connection -ComputerName $alias -Count 1).IPV4Address.IPAddressToString
If ($IP -eq '10.10.10.10') { Write-Host "$alias is using PRODUCTION IP" -ForegroundColor Red }
Else { Write-Host "$alias is not using the production IP" }
Don't retire TechNet! -
(Don't give up yet - 12,575+ strong and growing)

Similar Messages

  • MBAM 2.5 SPN Issue with DNS alias and reporting

    We have one server with administration and monitoring website and self-service portal setup on it. We have another server with the Databases and the reports running on it. When I initially set it up I set it up with a SPN that matched the host name. At this
    point reporting worked.
    We found that HTTP SPN that matches host/FQDN name ibreaks WINRM to the server (powershell remoting).  See this: https://connect.microsoft.com/PowerShell/feedback/details/751307/psremoting-breaks-because-it-used-spn-name-with-class-http-instead-of-using-wsman
    To fix that we created a DNS alias, mbam.ourdomain.com, and created http SPN's for that account mapped to our MBAM ID
    When we did this we initially got stuck even logging on with single sign-on. we made a change to the endpoint address in the web.config and pointed it to the alias -- this resolved that issue.
    However now when trying to open any one of the reports we get the resource can not be found http 404 error.
    Is this fixable by changing something in a config file somewhere or do I need rebuild the servers and reinstall?

    Yes, We set both of those. We also set the delegation for the apppooluser to "trust this user for delegation to any service".<o:p></o:p>
    Today we uninstalled and reinstalled/configured IIS, the Administration and Monitoring website, and the self-service portal.<o:p></o:p>
     We no longer get an error when clicking on one of the 3 reports. Instead it does nothing. If I choose to open it in another tab or window it
    opens an about:blank page.<o:p></o:p>

  • Check-dns output

    Ran the check-dns perl script on my oes11 dsfw servers, I get these
    errors:
    ******************* Validation of DNS zone records creation for DSfW
    Domain Controller and Memeber Server *******************
    DNS record not found for ccg-ads1.ccg.net
    DNS record not found for ccg-ads3.ccg.net
    DNS SRV records NOT OK for _ldap._tcp.pdc._msdcs.ccg.net
    DNS PTR record NOT OK for 192.168.223.196 (192.168.223.196)
    DNS A record NOT OK for NEW10ZIGMGR.ccg.net
    DNS A record NOT OK for RAB-WIN7.ccg.net
    DNS A record NOT OK for SHR-WIN7.ccg.net
    DNS A record OK for CDS-WIN7.ccg.net
    DNS PTR record NOT OK for 192.168.20.39 (192.168.20.39)
    DNS A record NOT OK for DCC-WIN7.ccg.net
    DNS A record NOT OK for REC-WIN7.ccg.net
    DNS A record NOT OK for JUV_WIN7.ccg.net
    DNS A record NOT OK for WIN-7-64.ccg.net
    DNS A record NOT OK for COM-WIN7.ccg.net
    DNS A record NOT OK for ATT-WIN7.ccg.net
    DNS A record NOT OK for PWSWIN7.ccg.net
    DNS A record NOT OK for TRN-WIN7.ccg.net
    DNS A record NOT OK for TRE-WIN7.ccg.net
    DNS A record NOT OK for HRM-WIN7.ccg.net
    DNS A record NOT OK for CLK-WIN7.ccg.net
    I've gone through my dns console, the _ldap._tcp.pdc._msdcs entry
    points to my dsfw server that is PDC.
    I have dns records (A records) in my dsfw domain for ccg-ads1 &
    ccg-ads3.
    The other errors I'm not real concerned about at this time, as they are
    mainly templates for my VMware View virtual desktops.
    Suggestions?
    Stevo

    Originally Posted by Stevo
    psahukar sounds like they 'said':
    > Please check the resolv.conf on the DSfW server. It should be pointing
    > to the DNS server hosting the local DSfW domain.
    So my response to psahukar's comment is...
    Here is the resolv.conf. The first dns server is itself, the others
    are the other two DSFW servers here:
    search ccg.net
    nameserver 192.168.10.27
    nameserver 192.168.10.4
    nameserver 192.168.10.6
    All my DSFW servers are running dns.
    Stevo
    Hi,
    What is the output of 'rcnovell-named status' command from all the 3 DCs ?
    Thanks,
    Praveen Kumar

  • DNS Alias not Updating on Communication Channel

    Hi,
    We use DNS Aliases when connecting to some of our servers. One interface connects to a server using FTP with alias FTPServer.
    This FTPServer had a site switch over the weekend and the DNS Alias did not update in the communication channel. I had to ping the DNS Alias and put the server name into the CC to get the FTP to work.
    Is there any way of getting PI 7.1 to refresh the DNS?
    Thanks,
    Gareth

    Check out this intersting blog on aliasing.
    [Controlling DNS caching in the Java Virtual Machine (i.e. J2EE WAS)|Controlling DNS caching in the Java Virtual Machine (i.e. J2EE WAS)]
    I hope it might help
    Regards
    Ramesh

  • DNS Alias to named instance

    Hi, I have been recommended to create DNS aliases for the sql server instances so it be much more flexible for us to later migrated databases from server/instances to other server/instances... I really like this approach, but my SQL server consist of several
    named intances, one for every service/application. 
    Its easy to create a dns alias for a server name, but is it even possible to create DNS aliases for each named instance?
    And question two, is it possible to run all named instances on port 1433?
    Thanks in advance.

    Its easy to create a dns alias for a server name, but is it even possible to create DNS aliases for each named instance?
    A DNS entry will resolve the host name to an IP address, but the instance name (or port number) will still need to be specified in client connection strings.  This will allow you to move a named instance to a different server without changing client
    connection strings as long as you retain the same instance name (or port number if you use a port number instead of instance name).
    For example, if you have 2 named instances on SERVERA named INSTANCE1 and INSTANCE2, you could create DNS records INSTANCE1.EXAMPLE.COM and INSTANCE2.EXAMPLE.COM both pointing to SERVERA.  The client connection string will still need to specify
    the instance name (e.g. INSTANCE1.EXAMPLE.COM\INSTANCE1 and INSTANCE2.EXAMPLE.COM\INSTANCE2).  That would allow you to move a named instance to different host transparently with only a DNS change (e.g. move INSTANCE1 to SERVERB and change INSTANCE1.EXAMPLE.COM
    to point to SERVERB.
    And question two, is it possible to run all named instances on port 1433?
    No (assuming the same IP address).  Each instance on a host must listen on a different port number.  It is ultimately the IP address and port number that uniquely identify an instance.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • DNS alias name for portal server

    Hi
    I am using sun ONE portal server 6.2. We have added the DNS alias for the hostname in the DNS server for the portal server.
    I have added this alias hostname configuration in
    a. organizational alias name of the amconsole
    b.Have modified the gateway.virtualhost name parameter in the /etc/opt/SUNWps/platform.conf.default file.
    Kindly let me know if I have to add to any other places as we are using SUN ONE webserver, application server, IM server.
    Waiting for your reply
    Best Regards
    Ramkumar Raghavan

    you also might need to add an entry into /opt/SUNWam/lib/AMConfig.properties and add a FQDN entry for your new dns alias.

  • DNS Alias Wildcard?

    Hello.
    Is it possible to create a DNS Alias Wildcard?
    For example, a DNS alias record something like *.mydomain.com?
    Regards,
    Kristin.

    The GUI won't let you do this, for sure. You can edit the zone files directly but I'd almost guarantee that the GUI would overwrite the file (thereby deleting the wildcard) if you edit the zone. If you don't edit the specific zone (i.e. you edit other zones, but leave this one alone) you should be OK.
    There is no easy way to lock out users from editing specific zones via the GUI. You may have to setup some kind of monitoring to alert you when the zone file changes and your wildcard disappears.

  • Change from Actual Host Name to a DNS alias

    Here is our current standalone Oracle Application Server 10g configuration:
    Platform
    UNIX Owner = ora10g (all services run from this account)
    Red Hat Enterprise Linux AS release 4
    All services run from this host
    Database version 10.2.0.4.0
    Infrastructure
    Version = 10.1.2.3
    Installation Type Identity Management
    OHome = /ins01_app01/oracle/oraInfra
    UNIX Owner = ora10g
    MiddleTier
    Version = 10.1.2.3
    Installation Type = Business Intelligence and Forms
    OHome = /ins01_app01/oracle/oraMidtier
    Only two mid tier components contain apps we use:
    Discoverer Viewer (integrated with EBS) and OC4J_Portal (for Web Services).
    I’m new at this so please bear with me. I want to change the URL from the actual host name to a DNS alias. For example, the current URL for Discover Viewer:
    https://actualhost.dom.com/discoverer/viewer
    I want to change the URL to use a DNS alias, such as this:
    https://devhost.dom.com/discoverer/viewer
    I have reviewed the following documentation on how I might accomplish this task:
    Oracle® Application Server Administrator's Guide 10g Release 2 (10.1.2)
    Chapter 8 Changing Network Configurations
    8.2.2 Changing the Hostname, Domain Name, or IP Address of a Middle-Tier Installation
    ID 734821.1 - chgiphost.sh Fails with java.lang.UnsatisfiedLinkError Can't find library pass (libpass.so or .so) in
    sun.boot.library.path or java.library.path
    However, there are some questions I want to resolve before proceeding:
    1) Am I on the correct path with section “8.2.2 Changing the Hostname”
    2) How can I confirm the middle-tier instance is registered with Oracle Internet Directory and therefore must supply the orcladmin password during this procedure.
    3) Are there any specific to our installation that I might be missing.
    Thanks,
    Pat

    1. Yes you are on the right track.
    2. You can confirm by going to AS Control Console for Midtier; click on Infrastructure link, among the top left links; and see which OID it points to.
    3. you seem to be having it all.
    AMN

  • Windows Server 2012 R2 Certificate Services - Online Responder DNS Alias

    I am setting up a 2012 R2 PKI. Going with an offline standalone Root with an enterprise issuing CA. This is how I'd like to configure OSCP if possible & supported.
    Build an OSCP array. Members will be in different sites. One in each office, one in the data center, and one in the DR data center. They will all be online 24x7. Host names are oscp1.company.com, oscp2.company.com, etc.
    I want to create four A records in DNS for OSCP.company.com. One with each host's IP address.
    The reason behind this is setting up the AIA extension. If I need to add a new online responder, I don't want to have to re-issue certificates so everyone can use it.
    Will this work?

    definitely, you can create A records with desired name as many as you need and use single "ocsp.company.com" URL in the AIA extension. This will work unless DNS resolves this URL to a OCSP service. In this scenario you may consider to configure "Netmask
    ordering" in DNS properties, so DNS will return the nearest OCSP server IP address.
    My weblog: en-us.sysadmins.lv
    PowerShell PKI Module: pspki.codeplex.com
    PowerShell Cmdlet Help Editor pscmdlethelpeditor.codeplex.com
    Check out new:
    SSL Certificate Verifier
    Check out new:
    PowerShell FCIV tool.

  • Impossible to access File server shares using a DNS alias

    I am currently testing migration scenarios to replace 2 standalone W2K3 File Servers into 1 W2K8R2 Failover Cluster.
    Everything went very well, shares are well accessible as long as I use the new File Server names, but...
    ... when I try to use DNS aliases (of the old servers), It is getting a nightmare!
    First, each time I tried to to connect to the shares using the alias name \\tempsf\ I got an error message prompting for Duplicate name on the network.
    I solved this first issue by applying the DisableStrictNameChecking
    reg key (see below). The Duplicate name error message disappeared and I was able to access to the \\tempsf\ folder but it was empty however I have 2 shares well displayed when accessing it through the real file server name. Moreover, I confirm that :
    ping tempsf resolves correctly the real file server name and IP
    nslookup tempsf do the same
    net view \\realfileserver displays my 2 shares
    net view \\tempsf doesn't display anything :-(
    Then, I almost tried everything currently documented :
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters Add a new DWORD value called DisableStrictNameChecking and set to 1.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters Add a new Multi-String value called OptionalNames. Enter one or more aliases, one per line.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters Add a new DWORD value called DisableLoopBackCheck and set to 1.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0 Add a new Multi-String Value BackConnectionHostNames. Enter one or more aliases, one per line.
    And also the SETSPN:
    setspn -A host/<your_ALIAS_name> <ServerrName>
    setspn -A host/<your_ALIAS_name.domain.com> <ServerNname>
    But still nothing... Launch date is approaching, I am feeling so desperate...
    Any idea? please... Thanks in advance,
    Max
    PS : Ahh yes, one more thing, we are using a third-party DNS here (Infoblox) but I don't think it could be the issue.

    Hello,
    Configure my new File Server (new name, new IP)
    Shutdown the old File Server
    Map the mirrored SAN disk to the new File Server
    Mount Storage and create shares (previously exported from old FS)
    Update Alias to point to point to new FS (in Infoblox)
    Update Reg keys, setspn and netdom as explained above
    Try access. Shares well displayed when using new FS name but nothing when using updated alias despite dns resolution is ok.
    I also found the following doc :
    http://blogs.technet.com/b/askcore/archive/2009/01/09/file-share-scoping-in-windows-server-2008-failover-clusters.aspx?PageIndex=2#comments which explain precisely the way the W2K8R2 File Servers are working but without giving any solution to my issue.
    Your doc was interesting but didn't help :-(
    Anyone else ? Thanks

  • Tomcat Redirection through DNS Alias

    Hi,
    We've just upgraded from BOE XI 3.1 SP2 to SP6 FP 6.3 which also upgraded Tomcat 5 to Tomcat 7.
    We used to access InfoViewApp using an alias in Tomcat 5. E.g https://wuinsights.wuintranet.net/
    This site redirects to https://wuinsights.wuintranet.net/InfoViewApp/logon.jsp and displays the InfoView Login Page.
    Since the upgrade to Tomcat 7, the redirection is not working anymore. It fails to load the page throwing the error: "Internet explorer cannot display the page."
    Direct link to Tomcat however works fine i.e https://<servername>:8443/ redirects to https://<servername>:8443/InfoViewApp/logon.jsp (set on the ROOT folder using index.html)
    We are not using Apache Redirector (httpd).
    I've checked the old server.xml file but could not find any entry of wuinsights.wuintranet.net in the <HOST> or <Engine> parameters.
    Ping, telnet to wuinsights.wuintranet.net resolves to the IP address of the Tomcat Server.
    Could anyone please let me know where/which file do we set this redirection in Tomcat?
    Appreciate your input.
    Thanks,
    Mingthingla Keishing

    Hi,
    Good to see you. If you were able to access your infoview page using https://wuinsights.wuintranet.net/InfoViewApp/logon.jsp it means your SSL port for the tomcat was 443.
    Currently it is not working for you in tomcat 7 but https://<servername>:8443/InfoViewApp/logon.jsp works for you.
    The issue is your tomcat 7 SSL port is 8443 which needs to be changed to 443. 8443 is the default SSL port for tomcat which needs to be changed manually.
    This can be easily changed in server.xml.
    Hope it helps.
    Regards
    Chinmaya

  • Powershell - Checking existance of a sql stored procedure exists

    Hi
    I have Googled for this answer but not able to clearly find an answer. I'm not sure how to go about this but....I need to write a Powershell script to check for the existance of a specific Stored Procedure. This is to save me time in my current job when
    customers have issues on their Servers.
    This is a script that I have written so far - I've put asterix where I don't know what to put in. Please can anyone help or give me direction please.
    $serverIp="10.1.2.3"
    $database="HOUSEDB"
    $SqlConnection.ConnectionString = "Server=" + $serverIp + ";Database=" + $database +
    ";Integrated Security=False;User Id=Joe123;Password=Password123"
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection $SqlConnection.ConnectionString
    $SqlConnection.Open()
    $sqlCommand = $SqlConnection.CreateCommand()
    $sqlCommand.CommandText="************************" #SQL Select statement normally goes here
    $adapter= New-Object System.Data.SqlClient.SqlDataAdapter $sqlCommand
    $dataset= New-Object System.Data.DataSet
    $rec=$adapter.Fill($dataset)
    Write-Host ***************************
    Cheers
    Matt

    This is how we test using SQL. There is not need to create datasets.  This method will always tell you if one or more objects are found.  It is also useful for getting record counts.  It is faster and less resource intensive than
    returning and filling a dataset.
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection $SqlConnection.ConnectionString
    $SqlConnection.Open()
    $sqlCommand = $SqlConnection.CreateCommand()
    $sqlCommand.CommandText="select * from FROM sysobjects WHERE name='my_stored-procedure'"
    if($sqlCommand.ExecuteScalar() -gt 0){
    Write-Host 'Your stored procedure was found' -fore green
    }else{
    Write-Host 'Your stored procedure was NOT found' -fore red
    ¯\_(ツ)_/¯

  • DNS Alias / Database name

    Hi folks!
    I have one question, is it possible to create alias name on DNS server for database (instance) name? I have test db on one machine and after migration i want to use alias name which is called test for second database server machine without changing host name locally or in application.
    Is thios possible and what to put in tnsnames?
    I have already tried but i fails.
    I have done :
    Created alias name TEST on DNS name and in its description put host name of server, and ping of it went ok
    I wanted to test is this working in case of dblink createion and recevie error Error : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    I have put in tnsnames this:
    TEST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = TEST)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = test)
    If this situation is specific please could you provide me correct entry for my case in tnsnames file?
    Thanks!

    rootsman wrote:
    Hi folks!
    I have one question, is it possible to create alias name on DNS server for database (instance) name? I have test db on one machine and after migration i want to use alias name which is called test for second database server machine without changing host name locally or in application.
    Is thios possible and what to put in tnsnames?
    I have already tried but i fails.
    I have done :
    Created alias name TEST on DNS name and in its description put host name of server, and ping of it went ok
    I wanted to test is this working in case of dblink createion and recevie error Error : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
    I have put in tnsnames this:
    TEST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = TEST)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = test)
    If this situation is specific please could you provide me correct entry for my case in tnsnames file?
    Thanks!Just to expand and clarify a bit of what LkrBrn posted ..
    In your above TNSNAMES.ORA entry, note the following:
    HOST=TEST "TEST" must resolve (via dns or local hosts file) to the ip address of a machine hosting an oracle listener
    PORT=1521 means the target machine ('TEST', in your case) must be listening on port 1521
    SERVICE_NAME=test means the listener using port 1521 on server 'TEST' must know of a database service called "test"
    whereas the entry name ("TEST = ...") can be anything, but that is the name which the client uses to refer to the database to which it wants to connect.

  • PowerShell - Check if device driver is up2date

    Hey Guys,
    I'm looking for a way to check if a new driver is available for a device via PowerShell.
    The result should be like clicking "check for driver updates" in the device manager.
    After a briefly search I can't find a way to do this, so if you know a solution, please share it with me.
    Greets,
    The Robb

    Start here and follow the instructions:
    http://windows.microsoft.com/en-us/windows7/automatically-get-recommended-drivers-and-updates-for-your-hardware
    ¯\_(ツ)_/¯

  • Need for DNS "Alias" record?

    Instead of creating a DNS CNAME ("Alias"),  as shown in
    http://support.microsoft.com/kb/168322
    what is wrong with this approach?
    mySqlServerPublicName         HOST (A)   123.......
    mySqlServerPrivateName       HOST (A)   172.16......
    The name of the underlying physical box is  "mySqlServerPrivateName" but end users should only refer to it, and access it, using "mySqlServerPublicName". (In short, I don't understand why a CNAME record is needed at all in this case)
    TIA,
    edm2

    mySqlServerPrivateName refers to HOST (A) 123....
    mySqlServerPrivateName refers to HOST (A) 172.16....
    the purpose of the CNAME is, let's say out of the blue, your boss tells you that for the IP Address HOST (A) 123... 
    change the IP Address to 220.... but all the users remember it as mySqlServerPrivateName.
    So you just change the Host (A) to 220 ... but the user's doesn't know that the IP Address has been changed.
    You don't have to inform user about the change of IP if the alias or cname is still the same.
    Hope it helps...
    Every second counts..make use of it. Disclaimer: This posting is provided AS IS with no warranties or guarantees and confers no rights.
    IT Stuff Quick Bytes

Maybe you are looking for

  • Getting error in a soap proxy from an applet

    Hi, I'm getting error in Applet window while it trying to get the SOAP PROXY from Applet. Does any one came cross this type of the problem? Please help!!! <b>Description:</b> I am using BEA workshop 8.1.4, I have created JSP which contain the Applet.

  • HT201272 I have lost my iTunes on my iPad how can I get it back

    Please help

  • Ipad 2 is not starting up

    My iPad 2 in the last two days has been very slow, in reaction time, and hangs. I have attempted to restart two to three times, to no avail. Should I erase all content and reload the apps and other content??

  • LIV report similar to MRNB which list multiple POs

    Hi All, Report MRNB (Revaluation of logistics invoice verification) has a limitation, we can only get the retrospective pricing for a particular item of a single PO for a given interval. Is there any standard LIV report similar to MRNB which gives re

  • Impossible de lire les vidéos tuto d'Adobe TV sous Windows 7

    Bonjour, Je n'arrive pas à lire les vidéos tutoriels sur Abobe TV, et pourtant je peux lire toutes les autres vidéos sur Youtube, Dailymotion etc... Les pages d'Adobe TV s'affichent correctement mais le lecteur reste complétement noir, c'est le cas s